本文整理汇总了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;
}
示例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());
}
}
示例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());
}
}
}
}
}
示例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());
}
}