本文整理汇总了PHP中DeferredUpdates::addHTMLCacheUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP DeferredUpdates::addHTMLCacheUpdate方法的具体用法?PHP DeferredUpdates::addHTMLCacheUpdate怎么用?PHP DeferredUpdates::addHTMLCacheUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeferredUpdates
的用法示例。
在下文中一共展示了DeferredUpdates::addHTMLCacheUpdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTMLCacheUpdates
/**
* Do cache updates for when the stable version of a page changed.
* Invalidates/purges pages that include the given page.
* @param Title $title
*/
public static function HTMLCacheUpdates(Title $title)
{
# Invalidate caches of articles which include this page...
DeferredUpdates::addHTMLCacheUpdate($title, 'templatelinks');
if ($title->getNamespace() == NS_FILE) {
DeferredUpdates::addHTMLCacheUpdate($title, 'imagelinks');
}
DeferredUpdates::addUpdate(new FRExtraCacheUpdate($title));
}
示例2: onArticleEdit
/**
* Purge caches on page update etc
*
* @param $title Title object
* @todo Verify that $title is always a Title object (and never false or null), add Title hint to parameter $title
*/
public static function onArticleEdit( $title ) {
// Invalidate caches of articles which include this page
DeferredUpdates::addHTMLCacheUpdate( $title, 'templatelinks' );
// Invalidate the caches of all pages which redirect here
DeferredUpdates::addHTMLCacheUpdate( $title, 'redirect' );
// Purge squid for this page only
$title->purgeSquid();
// Clear file cache for this page only
HTMLFileCache::clearFileCache( $title );
InfoAction::invalidateCache( $title );
}
示例3: onArticleEdit
/**
* Purge caches on page update etc
*
* @param Title $title
* @param Revision|null $revision Revision that was just saved, may be null
*/
public static function onArticleEdit(Title $title, Revision $revision = null)
{
// Invalidate caches of articles which include this page
DeferredUpdates::addHTMLCacheUpdate($title, 'templatelinks');
// Invalidate the caches of all pages which redirect here
DeferredUpdates::addHTMLCacheUpdate($title, 'redirect');
// Purge squid for this page only
$title->purgeSquid();
// Clear file cache for this page only
HTMLFileCache::clearFileCache($title);
$revid = $revision ? $revision->getId() : null;
DeferredUpdates::addCallableUpdate(function () use($title, $revid) {
InfoAction::invalidateCache($title, $revid);
});
}