Fixed behavior of Title::invalidateCache.
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index a8905d8..7cd1f72 100644 (file)
@@ -55,6 +55,22 @@ class InfoAction extends FormlessAction {
                return false;
        }
 
+       /**
+        * Clear the info cache for a given Title.
+        *
+        * @since 1.22
+        * @param Title $title Title to clear cache for
+        */
+       public static function invalidateCache( Title $title ) {
+               global $wgMemc;
+               // Clear page info.
+               $revision = WikiPage::factory( $title )->getRevision();
+               if ( $revision !== null ) {
+                       $memcKey = wfMemcKey( 'infoaction', $title->getPrefixedText(), $revision->getId() );
+                       $wgMemc->delete( $memcKey );
+               }
+       }
+
        /**
         * Shows page information on GET request.
         *