本文整理匯總了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);
});
}