/**
  * 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
0
	/**
	 * 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
0
 /**
  * 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);
     });
 }