當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTMLFileCache::fileCacheName方法代碼示例

本文整理匯總了PHP中HTMLFileCache::fileCacheName方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTMLFileCache::fileCacheName方法的具體用法?PHP HTMLFileCache::fileCacheName怎麽用?PHP HTMLFileCache::fileCacheName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTMLFileCache的用法示例。


在下文中一共展示了HTMLFileCache::fileCacheName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: invalidateCache

 /**
  * Updates page_touched for this page; called from LinksUpdate.php
  * @return bool true if the update succeded
  */
 public function invalidateCache()
 {
     global $wgUseFileCache;
     if (wfReadOnly()) {
         return;
     }
     $dbw = wfGetDB(DB_MASTER);
     $success = $dbw->update('page', array('page_touched' => $dbw->timestamp()), array('page_namespace' => $this->getNamespace(), 'page_title' => $this->getDBkey()), 'Title::invalidateCache');
     if ($wgUseFileCache) {
         $cache = new HTMLFileCache($this);
         @unlink($cache->fileCacheName());
     }
     return $success;
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:18,代碼來源:Title.php

示例2: onArticleEdit

 /**
  * Purge caches on page update etc
  */
 static function onArticleEdit($title)
 {
     global $wgDeferredUpdateList, $wgUseFileCache;
     // Invalidate caches of articles which include this page
     $update = new HTMLCacheUpdate($title, 'templatelinks');
     $wgDeferredUpdateList[] = $update;
     # Purge squid for this page only
     $title->purgeSquid();
     # Clear file cache
     if ($wgUseFileCache) {
         $cm = new HTMLFileCache($title);
         @unlink($cm->fileCacheName());
     }
 }
開發者ID:negabaro,項目名稱:alfresco,代碼行數:17,代碼來源:Article.php

示例3: invalidateIDs

 /**
  * Invalidate a set of IDs, right now
  */
 function invalidateIDs(ResultWrapper $res)
 {
     global $wgUseFileCache, $wgUseSquid;
     if ($res->numRows() == 0) {
         return;
     }
     $dbw = wfGetDB(DB_MASTER);
     $timestamp = $dbw->timestamp();
     $done = false;
     while (!$done) {
         # Get all IDs in this query into an array
         $ids = array();
         for ($i = 0; $i < $this->mRowsPerQuery; $i++) {
             $row = $res->fetchRow();
             if ($row) {
                 $ids[] = $row[0];
             } else {
                 $done = true;
                 break;
             }
         }
         if (!count($ids)) {
             break;
         }
         # Update page_touched
         $dbw->update('page', array('page_touched' => $timestamp), array('page_id IN (' . $dbw->makeList($ids) . ')'), __METHOD__);
         # Update squid
         if ($wgUseSquid || $wgUseFileCache) {
             $titles = Title::newFromIDs($ids);
             if ($wgUseSquid) {
                 $u = SquidUpdate::newFromTitles($titles);
                 $u->doUpdate();
             }
             # Update file cache
             if ($wgUseFileCache) {
                 foreach ($titles as $title) {
                     $cm = new HTMLFileCache($title);
                     @unlink($cm->fileCacheName());
                 }
             }
         }
     }
 }
開發者ID:BackupTheBerlios,項目名稱:shoutwiki-svn,代碼行數:46,代碼來源:HTMLCacheUpdate.php

示例4: onArticleEdit

 /**
  * Purge caches on page update etc
  */
 static function onArticleEdit($title)
 {
     global $wgDeferredUpdateList, $wgUseFileCache;
     $title->touchLinks();
     // Invalidate the caches of all pages which redirect here
     $wgDeferredUpdateList[] = new HTMLCacheUpdate($title, 'redirect');
     # Purge squid for this page only
     $title->purgeSquid();
     # Clear file cache
     if ($wgUseFileCache) {
         $cm = new HTMLFileCache($title);
         @unlink($cm->fileCacheName());
     }
 }
開發者ID:ErdemA,項目名稱:wikihow,代碼行數:17,代碼來源:Article.php


注:本文中的HTMLFileCache::fileCacheName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。