コード例 #1
0
ファイル: Generator.php プロジェクト: agentmedia/phine-core
 /**
  * Generates the xml by pulling it from cache or generating it
  * @return string
  */
 function Generate()
 {
     if ($this->cacher->MustUseCache()) {
         $this->xml = $this->cacher->GetFromCache();
         return;
     }
     $this->AddAllPages();
     $this->xml = $this->sitemap->SaveXml();
     if ($this->cacher->MustStoreToCache()) {
         $this->cacher->StoreToCache($this->xml);
     }
 }
コード例 #2
0
 /**
  * Gets cache content if necessary
  * @return boolean
  */
 protected function BeforeInit()
 {
     //todo: check access rights
     $cacheFile = PathUtil::ContentCacheFile($this);
     $this->fileCacher = new FileCacher($cacheFile, $this->content->GetCacheLifetime());
     if ($this->fileCacher->MustUseCache()) {
         $this->output = $this->fileCacher->GetFromCache();
         return true;
     }
     return parent::BeforeInit();
 }