예제 #1
0
 static function storeCache($key, $templateFilepath)
 {
     if (!eZTemplateTreeCache::isCacheEnabled()) {
         return false;
     }
     $templateCache =& eZTemplateTreeCache::cacheTable();
     $key = eZTemplateTreeCache::internalKey($key);
     if (!isset($templateCache[$key])) {
         eZDebug::writeDebug("Template cache for key '{$key}' does not exist, cannot store cache", __METHOD__);
         return;
     }
     $cacheFileName = eZTemplateTreeCache::treeCacheFilename($key, $templateFilepath);
     $cache =& $templateCache[$key];
     $php = new eZPHPCreator(eZTemplateTreeCache::cacheDirectory(), $cacheFileName);
     $php->addVariable('eZTemplateTreeCacheCodeDate', eZTemplateTreeCache::CODE_DATE);
     $php->addSpace();
     $php->addVariable('TemplateInfo', $cache['info']);
     $php->addSpace();
     $php->addVariable('TemplateRoot', $cache['root']);
     $php->store();
 }
 function setCachedTemplateTree($keyData, $uri, $res, $templatePath, &$extraParameters, &$root)
 {
     $key = $this->cacheKey($keyData, $res, $templatePath, $extraParameters);
     eZTemplateTreeCache::setCachedTree($key, $uri, $res, $templatePath, $extraParameters, $root);
     eZTemplateTreeCache::storeCache($key, $templatePath);
 }