From: Aaron Schulz Date: Mon, 27 Apr 2015 22:49:11 +0000 (-0700) Subject: Converted InfoAction to using the WAN cache X-Git-Tag: 1.31.0-rc.0~11497^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=19878798efa027dfe4973136d5f719d3bf7e9635;p=lhc%2Fweb%2Fwiklou.git Converted InfoAction to using the WAN cache Bug: T93141 Change-Id: I8988f77fa5a3504793d9b8e0eea6863888c9e226 --- diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index de4f977dcb..203c687eb4 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -64,12 +64,12 @@ class InfoAction extends FormlessAction { * @param Title $title Title to clear cache for */ public static function invalidateCache( Title $title ) { - global $wgMemc; + $cache = ObjectCache::getMainWANInstance(); $revision = Revision::newFromTitle( $title, 0, Revision::READ_LATEST ); if ( $revision !== null ) { $key = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $revision->getId() ); - $wgMemc->delete( $key ); + $cache->delete( $key ); } } @@ -193,7 +193,7 @@ class InfoAction extends FormlessAction { * @return array */ protected function pageInfo() { - global $wgContLang, $wgMemc; + global $wgContLang; $user = $this->getUser(); $lang = $this->getLanguage(); @@ -201,16 +201,17 @@ class InfoAction extends FormlessAction { $id = $title->getArticleID(); $config = $this->context->getConfig(); + $cache = ObjectCache::getMainWANInstance(); $memcKey = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $this->page->getLatest() ); - $pageCounts = $wgMemc->get( $memcKey ); + $pageCounts = $cache->get( $memcKey ); $version = isset( $pageCounts['cacheversion'] ) ? $pageCounts['cacheversion'] : false; if ( $pageCounts === false || $version !== self::CACHE_VERSION ) { // Get page information that would be too "expensive" to retrieve by normal means $pageCounts = $this->pageCounts( $title ); $pageCounts['cacheversion'] = self::CACHE_VERSION; - $wgMemc->set( $memcKey, $pageCounts ); + $cache->set( $memcKey, $pageCounts ); } // Get page properties