From e711503e7a1725c87f2b130971488a654f39e210 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 17 Nov 2013 22:09:31 +0100 Subject: [PATCH] Remove underscore from classes LCStore_* iPart of program to remove underscores from class names. Checked core and 600+ extensions for occurrences. All uses are in core, and are updated in this change. Change-Id: I432dc249d22053728013ae7d0d56c3c398021c5e --- includes/AutoLoader.php | 8 ++++---- includes/cache/LocalisationCache.php | 22 +++++++++++----------- maintenance/doMaintenance.php | 2 +- maintenance/dumpIterator.php | 2 +- maintenance/update.php | 2 +- tests/phpunit/phpunit.php | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index ac6f7167ba..6afd164e6c 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -128,10 +128,10 @@ $wgAutoloadLocalClasses = array( 'IndexPager' => 'includes/Pager.php', 'Interwiki' => 'includes/interwiki/Interwiki.php', 'LCStore' => 'includes/cache/LocalisationCache.php', - 'LCStore_Accel' => 'includes/cache/LocalisationCache.php', - 'LCStore_CDB' => 'includes/cache/LocalisationCache.php', - 'LCStore_DB' => 'includes/cache/LocalisationCache.php', - 'LCStore_Null' => 'includes/cache/LocalisationCache.php', + 'LCStoreAccel' => 'includes/cache/LocalisationCache.php', + 'LCStoreCDB' => 'includes/cache/LocalisationCache.php', + 'LCStoreDB' => 'includes/cache/LocalisationCache.php', + 'LCStoreNull' => 'includes/cache/LocalisationCache.php', 'License' => 'includes/Licenses.php', 'Licenses' => 'includes/Licenses.php', 'Linker' => 'includes/Linker.php', diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index 2d017b34d2..3838c9bca4 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -195,16 +195,16 @@ class LocalisationCache { switch ( $conf['store'] ) { case 'files': case 'file': - $storeClass = 'LCStore_CDB'; + $storeClass = 'LCStoreCDB'; break; case 'db': - $storeClass = 'LCStore_DB'; + $storeClass = 'LCStoreDB'; break; case 'accel': - $storeClass = 'LCStore_Accel'; + $storeClass = 'LCStoreAccel'; break; case 'detect': - $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB'; + $storeClass = $wgCacheDirectory ? 'LCStoreCDB' : 'LCStoreDB'; break; default: throw new MWException( @@ -404,7 +404,7 @@ class LocalisationCache { $deps = $this->store->get( $code, 'deps' ); $keys = $this->store->get( $code, 'list' ); $preload = $this->store->get( $code, 'preload' ); - // Different keys may expire separately, at least in LCStore_Accel + // Different keys may expire separately, at least in LCStoreAccel if ( $deps === null || $keys === null || $preload === null ) { wfDebug( __METHOD__ . "($code): cache missing, need to make one\n" ); @@ -901,7 +901,7 @@ class LocalisationCache { # 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 ) { + if ( !$this->store instanceof LCStoreNull ) { MessageBlobStore::clear(); } @@ -966,7 +966,7 @@ class LocalisationCache { * Disable the storage backend */ public function disableBackend() { - $this->store = new LCStore_Null; + $this->store = new LCStoreNull; $this->manualRecache = false; } } @@ -1021,7 +1021,7 @@ interface LCStore { * This will work if one of XCache, WinCache or APC cacher is configured. * (See ObjectCache.php) */ -class LCStore_Accel implements LCStore { +class LCStoreAccel implements LCStore { var $currentLang; var $keys; @@ -1070,7 +1070,7 @@ class LCStore_Accel implements LCStore { * LCStore implementation which uses the standard DB functions to store data. * This will work on any MediaWiki installation. */ -class LCStore_DB implements LCStore { +class LCStoreDB implements LCStore { var $currentLang; var $writesDone = false; @@ -1173,7 +1173,7 @@ class LCStore_DB implements LCStore { * * See Cdb.php and http://cr.yp.to/cdb.html */ -class LCStore_CDB implements LCStore { +class LCStoreCDB implements LCStore { var $readers, $writer, $currentLang, $directory; function __construct( $conf = array() ) { @@ -1254,7 +1254,7 @@ class LCStore_CDB implements LCStore { /** * Null store backend, used to avoid DB errors during install */ -class LCStore_Null implements LCStore { +class LCStoreNull implements LCStore { public function get( $code, $key ) { return null; } diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index 3bd508cbfe..3157318a7f 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -98,7 +98,7 @@ if ( $maintenance->getDbType() === Maintenance::DB_ADMIN && if ( $maintenance->getDbType() === Maintenance::DB_NONE ) { if ( $wgLocalisationCacheConf['storeClass'] === false && ( $wgLocalisationCacheConf['store'] == 'db' || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) ) ) { - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; + $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; } } $maintenance->finalSetup(); diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php index dd468a9fc8..73296b7d2b 100644 --- a/maintenance/dumpIterator.php +++ b/maintenance/dumpIterator.php @@ -97,7 +97,7 @@ abstract class DumpIterator extends Maintenance { if ( $this->getDbType() == Maintenance::DB_NONE ) { global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks; $wgUseDatabaseMessages = false; - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; + $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; $wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis'; } } diff --git a/maintenance/update.php b/maintenance/update.php index 5c93964ef4..e39661a1de 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -180,7 +180,7 @@ class UpdateMediaWiki extends Maintenance { # cache from $wgExtensionFunctions (bug 20471) $wgLocalisationCacheConf = array( 'class' => 'LocalisationCache', - 'storeClass' => 'LCStore_Null', + 'storeClass' => 'LCStoreNull', 'storeDirectory' => false, 'manualRecache' => false, ); diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 1d65e521b5..401b8a8658 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -49,7 +49,7 @@ class PHPUnitMaintClass extends Maintenance { // Assume UTC for testing purposes $wgLocaltimezone = 'UTC'; - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; + $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; // Bug 44192 Do not attempt to send a real e-mail Hooks::clear( 'AlternateUserMailer' ); -- 2.20.1