* Added $wgLanguageConverterCacheType global to control LC cache type. We can use it to enable direct apc use for language converter (to match the live hack).
* Added $wgLangConvMemc object, available via Setup.php
Change 1:
* Updated unit tests
* Minor documentation cleanup in DefaultSettings.php
Change-Id: Icd5dd28407e9759ce294c784ec41d9ca15c89616
*/
$wgParserCacheType = CACHE_ANYTHING;
*/
$wgParserCacheType = CACHE_ANYTHING;
+/**
+ * The cache type for storing language conversion tables,
+ * which are used when parsing certain text and interface messages.
+ *
+ * For available types see $wgMainCacheType.
+ */
+$wgLanguageConverterCacheType = CACHE_ANYTHING;
+
/**
* Advanced object cache configuration.
*
* Use this to define the class names and constructor parameters which are used
* for the various cache types. Custom cache types may be defined here and
/**
* Advanced object cache configuration.
*
* Use this to define the class names and constructor parameters which are used
* for the various cache types. Custom cache types may be defined here and
- * referenced from $wgMainCacheType, $wgMessageCacheType or $wgParserCacheType.
+ * referenced from $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType,
+ * or $wgLanguageConverterCacheType.
*
* The format is an associative array where the key is a cache identifier, and
* the value is an associative array of parameters. The "class" parameter is the
*
* The format is an associative array where the key is a cache identifier, and
* the value is an associative array of parameters. The "class" parameter is the
* );
*/
$wgParserTestRemote = false;
* );
*/
$wgParserTestRemote = false;
/**
* Allow running of javascript test suites via [[Special:JavaScriptTest]] (such as QUnit).
*/
/**
* Allow running of javascript test suites via [[Special:JavaScriptTest]] (such as QUnit).
*/
return ObjectCache::getInstance( $wgParserCacheType );
}
return ObjectCache::getInstance( $wgParserCacheType );
}
+/**
+ * Get the cache object used by the language converter
+ *
+ * @return BagOStuff
+ */
+function wfGetLangConverterCacheStorage() {
+ global $wgLanguageConverterCacheType;
+ return ObjectCache::getInstance( $wgLanguageConverterCacheType );
+}
+
/**
* Call hook functions defined in $wgHooks
*
/**
* Call hook functions defined in $wgHooks
*
if ( !empty($wgActionPaths) && !isset($wgActionPaths['view']) ) {
# 'view' is assumed the default action path everywhere in the code
if ( !empty($wgActionPaths) && !isset($wgActionPaths['view']) ) {
# 'view' is assumed the default action path everywhere in the code
- # but is rarely filled in $wgActionPaths
+ # but is rarely filled in $wgActionPaths
$wgActionPaths['view'] = $wgArticlePath ;
}
$wgActionPaths['view'] = $wgArticlePath ;
}
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
+$wgLangConvMemc = wfGetLangConverterCacheStorage();
wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' .
get_class( $messageMemc ) . '[message] ' .
wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' .
get_class( $messageMemc ) . '[message] ' .
* @param $fromCache Boolean: load from memcached? Defaults to true.
*/
function loadTables( $fromCache = true ) {
* @param $fromCache Boolean: load from memcached? Defaults to true.
*/
function loadTables( $fromCache = true ) {
+ global $wgLangConvMemc;
+
if ( $this->mTablesLoaded ) {
return;
}
if ( $this->mTablesLoaded ) {
return;
}
wfProfileIn( __METHOD__ );
$this->mTablesLoaded = true;
$this->mTables = false;
if ( $fromCache ) {
wfProfileIn( __METHOD__ . '-cache' );
wfProfileIn( __METHOD__ );
$this->mTablesLoaded = true;
$this->mTables = false;
if ( $fromCache ) {
wfProfileIn( __METHOD__ . '-cache' );
- $this->mTables = $wgMemc->get( $this->mCacheKey );
+ $this->mTables = $wgLangConvMemc->get( $this->mCacheKey );
wfProfileOut( __METHOD__ . '-cache' );
}
if ( !$this->mTables
wfProfileOut( __METHOD__ . '-cache' );
}
if ( !$this->mTables
$this->postLoadTables();
$this->mTables[self::CACHE_VERSION_KEY] = true;
$this->postLoadTables();
$this->mTables[self::CACHE_VERSION_KEY] = true;
- $wgMemc->set( $this->mCacheKey, $this->mTables, 43200 );
+ $wgLangConvMemc->set( $this->mCacheKey, $this->mTables, 43200 );
wfProfileOut( __METHOD__ . '-recache' );
}
wfProfileOut( __METHOD__ );
wfProfileOut( __METHOD__ . '-recache' );
}
wfProfileOut( __METHOD__ );
public function finalSetup() {
parent::finalSetup();
public function finalSetup() {
parent::finalSetup();
- global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgUseDatabaseMessages;
+ global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType;
+ global $wgLanguageConverterCacheType, $wgUseDatabaseMessages;
global $wgLocaltimezone, $wgLocalisationCacheConf;
$wgMainCacheType = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
global $wgLocaltimezone, $wgLocalisationCacheConf;
$wgMainCacheType = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
+ $wgLanguageConverterCacheType = CACHE_NONE;
$wgUseDatabaseMessages = false; # Set for future resets
$wgUseDatabaseMessages = false; # Set for future resets
if( !in_array( '--configuration', $_SERVER['argv'] ) ) {
//Hack to eliminate the need to use the Makefile (which sucks ATM)
if( !in_array( '--configuration', $_SERVER['argv'] ) ) {
//Hack to eliminate the need to use the Makefile (which sucks ATM)
- array_splice( $_SERVER['argv'], 1, 0,
+ array_splice( $_SERVER['argv'], 1, 0,
array( '--configuration', $IP . '/tests/phpunit/suite.xml' ) );
}
array( '--configuration', $IP . '/tests/phpunit/suite.xml' ) );
}