$wgLBFactoryConf['serverTemplate']['user'] = $wgDBuser;
$wgLBFactoryConf['serverTemplate']['password'] = $wgDBpassword;
}
+ LBFactory::destroyInstance();
}
- if ( defined( 'MW_CMDLINE_CALLBACK' ) ) {
- $fn = MW_CMDLINE_CALLBACK;
- $fn();
- }
+ $this->afterFinalSetup();
$wgShowSQLErrors = true;
@set_time_limit( 0 );
$wgProfiling = false; // only for Profiler.php mode; avoids OOM errors
}
+ /**
+ * Execute a callback function at the end of initialisation
+ */
+ protected function afterFinalSetup() {
+ if ( defined( 'MW_CMDLINE_CALLBACK' ) ) {
+ call_user_func( MW_CMDLINE_CALLBACK );
+ }
+ }
+
/**
* Potentially debug globals. Originally a feature only
* for refreshLinks
* @ingroup Maintenance
*/
-define( 'MW_CMDLINE_CALLBACK', 'wfSetupUpdateScript' );
$wgUseMasterForMaintenance = true;
require_once( 'Maintenance.php' );
$this->output( "Done.\n" );
}
-}
-function wfSetupUpdateScript() {
- global $wgLocalisationCacheConf;
-
- # Don't try to access the database
- # This needs to be disabled early since extensions will try to use the l10n
- # cache from $wgExtensionSetupFunctions (bug 20471)
- $wgLocalisationCacheConf = array(
- 'class' => 'LocalisationCache',
- 'storeClass' => 'LCStore_Null',
- 'storeDirectory' => false,
- 'manualRecache' => false,
- );
+ protected function afterFinalSetup() {
+ global $wgLocalisationCacheConf;
+
+ # Don't try to access the database
+ # This needs to be disabled early since extensions will try to use the l10n
+ # cache from $wgExtensionSetupFunctions (bug 20471)
+ $wgLocalisationCacheConf = array(
+ 'class' => 'LocalisationCache',
+ 'storeClass' => 'LCStore_Null',
+ 'storeDirectory' => false,
+ 'manualRecache' => false,
+ );
+ }
}
$maintClass = 'UpdateMediaWiki';