Fixed behavior of Title::invalidateCache.
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index 55fa108..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.
         *
@@ -602,7 +618,7 @@ class InfoAction extends FormlessAction {
                        'COUNT(*)',
                        array(
                                'wl_namespace' => $title->getNamespace(),
-                               'wl_title'     => $title->getDBkey(),
+                               'wl_title' => $title->getDBkey(),
                        ),
                        __METHOD__
                );