r72411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72410‎ | r72411 | r72412 >
Date:10:28, 5 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Prefer memcached + use canonical name for function
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -897,7 +897,7 @@
898898 global $wgTranslateCC, $wgTranslateEC, $wgTranslateAC;
899899 global $wgAutoloadClasses;
900900
901 - $key = wfMemckey( 'translate-groups' );
 901+ $key = wfMemcKey( 'translate-groups' );
902902 $value = DependencyWrapper::getValueFromCache( self::getCache(), $key );
903903
904904 if ( $value === null ) {
@@ -926,12 +926,14 @@
927927 }
928928
929929 /**
930 - * Returns a cache object. Currently just wrapper for
931 - * database cache, but @todo could be improved or replaced
932 - * with something that prefers Memcached over db.
 930+ * Returns a cacher object.
933931 */
934932 protected static function getCache() {
935 - return wfGetCache( CACHE_DB );
 933+ $cacher = wfGetCache( CACHE_MEMCACHED );
 934+ if ( $cacher instanceof FakeMemCachedClient ) {
 935+ $cacher = wfGetCache( CACHE_DB );
 936+ }
 937+ return $cacher;
936938 }
937939
938940 /**

Status & tagging log