$storeClass = 'LCStore_Accel';
break;
case 'detect':
- try {
- $c = wfGetCache( CACHE_ACCEL );
- $storeClass = 'LCStore_Accel';
- } catch( Exception $c ) {
- $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB';
- }
+ $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB';
break;
default:
throw new MWException(
* @param $code
*/
public function recache( $code ) {
- global $wgExtensionMessagesFiles, $wgExtensionAliasesFiles;
+ global $wgExtensionMessagesFiles;
wfProfileIn( __METHOD__ );
if ( !$code ) {
}
}
- # Load deprecated $wgExtensionAliasesFiles
- foreach ( $wgExtensionAliasesFiles as $fileName ) {
- $data = $this->readPHPFile( $fileName, 'aliases' );
-
- if ( !isset( $data['aliases'] ) ) {
- continue;
- }
-
- $used = $this->mergeExtensionItem( $codeSequence, 'specialPageAliases',
- $allData['specialPageAliases'], $data['aliases'] );
-
- if ( $used ) {
- $deps[] = new FileDependency( $fileName );
- }
- }
-
# Merge core data into extension data
foreach ( $coreData as $key => $item ) {
$this->mergeItem( $key, $allData[$key], $item );
# Add cache dependencies for any referenced globals
$deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
- $deps['wgExtensionAliasesFiles'] = new GlobalDependency( 'wgExtensionAliasesFiles' );
$deps['version'] = new ConstantDependency( 'MW_LC_VERSION' );
# Add dependencies to the cache entry
$this->loadedItems[$code][$key] = true;
}
- # Write data to the persistant store
- $this->saveLangInStore( $code, $data );
-
- wfProfileOut( __METHOD__ );
- }
-
- /**
- * Helper for recache() this is not mean to be called outside of recache()
- * When the localisation store is null (LCStore_Null), method does nothing.
- *
- * @param $code String: language code to save data for
- * @param $data Array: language data forged by recache()
- */
- protected function saveLangInStore( $code, $data ) {
- wfProfileIn( __METHOD__ );
-
- if( $this->store instanceof LCStore_Null ) {
- # No point in saving data to /dev/null
- wfProfileOut( __METHOD__ );
- return;
- }
-
# Save to the persistent cache
$this->store->startWrite( $code );
- foreach ( $data as $key => $value ) {
+ foreach ( $allData as $key => $value ) {
if ( in_array( $key, self::$splitKeys ) ) {
foreach ( $value as $subkey => $subvalue ) {
$this->store->set( "$key:$subkey", $subvalue );
$this->store->finishWrite();
# Clear out the MessageBlobStore
- MessageBlobStore::clear();
+ # 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__ );
}
/**
* LCStore implementation which uses PHP accelerator to store data.
- * This will work if one of XCache, eAccelerator, or APC cacher is configured.
+ * This will work if one of XCache, WinCache or APC cacher is configured.
* (See ObjectCache.php)
*/
class LCStore_Accel implements LCStore {
$this->unload( $code );
}
}
-}
+}
\ No newline at end of file