* Define cachekey in cache.php.
This commit is contained in:
@@ -16,3 +16,18 @@ $config->cache->fullPages[] = 'product|all';
|
||||
$config->cache->fullPages[] = 'project|browse';
|
||||
$config->cache->fullPages[] = 'block|printblock';
|
||||
$config->cache->fullPages[] = 'screen|view';
|
||||
|
||||
$config->cacheKeys = new stdclass();
|
||||
|
||||
$config->cacheKeys->block = new stdclass();
|
||||
$config->cacheKeys->block->welcome = 'welcome';
|
||||
$config->cacheKeys->block->contribute = 'contribute';
|
||||
$config->cacheKeys->block->projectStatistic = 'projectStatistic%s%s%s';
|
||||
$config->cacheKeys->block->recentProject = 'recentProject';
|
||||
|
||||
$config->cacheKeys->execution = new stdclass();
|
||||
$config->cacheKeys->execution->ajaxGetDropMenuProjects = 'ajaxDropMenuProjects';
|
||||
$config->cacheKeys->execution->ajaxGetDropMenuExecutions = 'ajaxDropMenuExecutions';
|
||||
|
||||
$config->cacheKeys->bug = new stdclass();
|
||||
$config->cacheKeys->bug->browse = 'bugBrowse%s';
|
||||
|
||||
@@ -380,7 +380,7 @@ class block extends control
|
||||
{
|
||||
$this->view->tutorialed = $this->loadModel('tutorial')->getTutorialed();
|
||||
|
||||
$cacheKey = 'welcomeBlockData';
|
||||
$cacheKey = $this->config->cacheKeys->block->welcome;
|
||||
if(helper::isCacheEnabled() && $this->cache->has($cacheKey))
|
||||
{
|
||||
$data = $this->cache->get($cacheKey);
|
||||
@@ -418,14 +418,15 @@ class block extends control
|
||||
*/
|
||||
public function contribute()
|
||||
{
|
||||
if(helper::isCacheEnabled() && $this->cache->has('contributeBlockData'))
|
||||
$cacheKey = $this->config->cacheKeys->block->contribute;
|
||||
if(helper::isCacheEnabled() && $this->cache->has($cacheKey))
|
||||
{
|
||||
$data = $this->cache->get('contributeBlockData');
|
||||
$data = $this->cache->get($cacheKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = $this->loadModel('user')->getPersonalData();
|
||||
if($this->config->cache->enable) $this->cache->set('contributeBlockData', $data);
|
||||
if($this->config->cache->enable) $this->cache->set($cacheKey, $data);
|
||||
}
|
||||
$this->view->data = $data;
|
||||
$this->display();
|
||||
@@ -983,7 +984,7 @@ class block extends control
|
||||
return false;
|
||||
}
|
||||
|
||||
$cacheKey = __FUNCTION__ . $status . $count . $excludedModel;
|
||||
$cacheKey = sprintf($this->config->cacheKeys->block->projectStatistic, $status, $count, $excludedModel);
|
||||
if(helper::isCacheEnabled() && $this->cache->has($cacheKey))
|
||||
{
|
||||
$projects = $this->cache->get($cacheKey);
|
||||
@@ -2036,7 +2037,7 @@ class block extends control
|
||||
/* load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager(0, 3, 1);
|
||||
$cacheKey = __FUNCTION__;
|
||||
$cacheKey = $this->config->cacheKeys->block->recentProject;
|
||||
if(helper::isCacheEnabled() && $this->cache->has($cacheKey))
|
||||
{
|
||||
$this->app->loadLang('project');
|
||||
|
||||
@@ -165,7 +165,7 @@ class bug extends control
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Get executions. */
|
||||
$cacheKey = "bugBrowse{$this->projectID}";
|
||||
$cacheKey = sprintf($this->config->cacheKeys->bug->browse, $this->projectID);
|
||||
if(helper::isCacheEnabled() && $this->cache->has($cacheKey))
|
||||
{
|
||||
$executions = $this->cache->get($cacheKey);
|
||||
|
||||
@@ -3193,7 +3193,7 @@ class execution extends control
|
||||
* Manage products.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param from $from
|
||||
* @param string $from
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -3831,8 +3831,8 @@ class execution extends control
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->extra = $extra;
|
||||
|
||||
$cacheProjectsKey = 'execution|dropmenu|project';
|
||||
$cacheExecutionsKey = 'execution|dropmenu|executions';
|
||||
$cacheProjectsKey = $this->config->cacheKeys->execution->ajaxGetDropMenuProjects;
|
||||
$cacheExecutionsKey = $this->config->cacheKeys->execution->ajaxGetDropMenuExecutions;
|
||||
|
||||
if(helper::isCacheEnabled())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user