当前位置: 首页>>代码示例>>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;未经允许,请勿转载。