return self::$instance;
}
+ /**
+ * Destory the instance
+ * Actually used by maintenace/parserTests.inc to force to reopen connection
+ * when $wgDBprefix has changed
+ */
+ static function destroy(){
+ self::$instance = null;
+ }
+
/**
* Construct a factory based on a configuration array (typically from $wgLBFactoryConf)
*/
'wgUseTidy' => false,
'wgDefaultLanguageVariant' => $variant,
'wgVariantArticlePath' => false,
+ 'wgGroupPermissions' => array( '*' => array(
+ 'createaccount' => true,
+ 'read' => true,
+ 'edit' => true,
+ 'createpage' => true,
+ 'createtalk' => true,
+ ) ),
+ 'wgDefaultExternalStore' => array(),
);
$this->savedGlobals = array();
foreach( $settings as $var => $val ) {
$GLOBALS['wgLang'] = $langObj;
$GLOBALS['wgContLang'] = $langObj;
- $GLOBALS['wgLoadBalancer']->loadMasterPos();
//$GLOBALS['wgMessageCache'] = new MessageCache( new BagOStuff(), false, 0, $GLOBALS['wgDBname'] );
$this->setupDatabase();
# Make sure we don't mess with the live DB
if (!$setupDB && $wgDBprefix === 'parsertest_') {
# oh teh horror
- $GLOBALS['wgLoadBalancer'] = LoadBalancer::newFromParams( $GLOBALS['wgDBservers'] );
+ LBFactory::destroy();
$db = wfGetDB( DB_MASTER );
$tables = $this->listTables();