*/
var $recachedLangs = array();
- /**
- * Data added by extensions using the deprecated $wgMessageCache->addMessages()
- * interface.
- */
- var $legacyData = array();
-
/**
* All item keys
*/
* Get a subitem, for instance a single message for a given language.
*/
public function getSubitem( $code, $key, $subkey ) {
- if ( isset( $this->legacyData[$code][$key][$subkey] ) ) {
- return $this->legacyData[$code][$key][$subkey];
- }
if ( !isset( $this->loadedSubitems[$code][$key][$subkey] )
&& !isset( $this->loadedItems[$code][$key] ) )
{
$allData['defaultUserOptionOverrides'] = array();
}
- # Set the preload key
- $allData['preload'] = $this->buildPreload( $allData );
-
# Set the list keys
$allData['list'] = array();
foreach ( self::$splitKeys as $key ) {
'Check that your languages/messages/MessagesEn.php file is intact.' );
}
+ # Set the preload key
+ $allData['preload'] = $this->buildPreload( $allData );
+
# Save to the process cache and register the items loaded
$this->data[$code] = $allData;
foreach ( $allData as $key => $item ) {
}
}
$this->store->finishWrite();
+
+ # Clear out the MessageBlobStore
+ # HACK: If using a null (i.e. disabled) storage backend, we
+ # can't write to the MessageBlobStore either
+ if ( !$this->store instanceof LCStore_Null ) {
+ MessageBlobStore::clear();
+ }
wfProfileOut( __METHOD__ );
}
unset( $this->loadedItems[$code] );
unset( $this->loadedSubitems[$code] );
unset( $this->initialisedLangs[$code] );
- // We don't unload legacyData because there's no way to get it back
- // again, it's not really a cache
foreach ( $this->shallowFallbacks as $shallowCode => $fbCode ) {
if ( $fbCode === $code ) {
$this->unload( $shallowCode );
}
}
- /**
- * Add messages to the cache, from an extension that has not yet been
- * migrated to $wgExtensionMessages or the LocalisationCacheRecache hook.
- * Called by deprecated function $wgMessageCache->addMessages().
- */
- public function addLegacyMessages( $messages ) {
- foreach ( $messages as $lang => $langMessages ) {
- if ( isset( $this->legacyData[$lang]['messages'] ) ) {
- $this->legacyData[$lang]['messages'] =
- $langMessages + $this->legacyData[$lang]['messages'];
- } else {
- $this->legacyData[$lang]['messages'] = $langMessages;
- }
- }
- }
-
/**
* Disable the storage backend
*/
* @param $code Language code
* @param $key Cache key
*/
- public function get( $code, $key );
+ function get( $code, $key );
/**
* Start a write transaction.
* @param $code Language code
*/
- public function startWrite( $code );
+ function startWrite( $code );
/**
* Finish a write transaction.
*/
- public function finishWrite();
+ function finishWrite();
/**
* Set a key to a given value. startWrite() must be called before this
* is called, and finishWrite() must be called afterwards.
*/
- public function set( $key, $value );
+ function set( $key, $value );
}