/** * Constructor, always call this from child classes. */ public function __construct() { global $wgMessagesDirs, $wgUser; // Disable the i18n cache Language::getLocalisationCache()->disableBackend(); // Disable LoadBalancer and wfGetDB etc. LBFactory::disableBackend(); // Disable object cache (otherwise CACHE_ANYTHING will try CACHE_DB and // SqlBagOStuff will then throw since we just disabled wfGetDB) $GLOBALS['wgMemc'] = new EmptyBagOStuff(); ObjectCache::clear(); $emptyCache = array('class' => 'EmptyBagOStuff'); $GLOBALS['wgObjectCaches'] = array(CACHE_NONE => $emptyCache, CACHE_DB => $emptyCache, CACHE_ANYTHING => $emptyCache, CACHE_MEMCACHED => $emptyCache); // Load the installer's i18n. $wgMessagesDirs['MediawikiInstaller'] = __DIR__ . '/i18n'; // Having a user with id = 0 safeguards us from DB access via User::loadOptions(). $wgUser = User::newFromId(0); $this->settings = $this->internalDefaults; foreach ($this->defaultVarNames as $var) { $this->settings[$var] = $GLOBALS[$var]; } $this->doEnvironmentPreps(); $this->compiledDBs = array(); foreach (self::getDBTypes() as $type) { $installer = $this->getDBInstaller($type); if (!$installer->isCompiled()) { continue; } $this->compiledDBs[] = $type; } $this->parserTitle = Title::newFromText('Installer'); $this->parserOptions = new ParserOptions(); // language will be wrong :( $this->parserOptions->setEditSection(false); }
/** * Constructor, always call this from child classes. */ public function __construct() { global $wgExtensionMessagesFiles, $wgUser; // Disable the i18n cache and LoadBalancer Language::getLocalisationCache()->disableBackend(); LBFactory::disableBackend(); // Load the installer's i18n file. $wgExtensionMessagesFiles['MediawikiInstaller'] = dirname(__FILE__) . '/Installer.i18n.php'; // Having a user with id = 0 safeguards us from DB access via User::loadOptions(). $wgUser = User::newFromId(0); $this->settings = $this->internalDefaults; foreach ($this->defaultVarNames as $var) { $this->settings[$var] = $GLOBALS[$var]; } $compiledDBs = array(); foreach (self::getDBTypes() as $type) { $installer = $this->getDBInstaller($type); if (!$installer->isCompiled()) { continue; } $compiledDBs[] = $type; $defaults = $installer->getGlobalDefaults(); foreach ($installer->getGlobalNames() as $var) { if (isset($defaults[$var])) { $this->settings[$var] = $defaults[$var]; } else { $this->settings[$var] = $GLOBALS[$var]; } } } $this->setVar('_CompiledDBs', $compiledDBs); $this->parserTitle = Title::newFromText('Installer'); $this->parserOptions = new ParserOptions(); // language will be wrong :( $this->parserOptions->setEditSection(false); }
/** * Constructor, always call this from child classes. */ public function __construct() { global $wgMessagesDirs, $wgUser; // Disable the i18n cache and LoadBalancer Language::getLocalisationCache()->disableBackend(); LBFactory::disableBackend(); // Load the installer's i18n. $wgMessagesDirs['MediawikiInstaller'] = __DIR__ . '/i18n'; // Having a user with id = 0 safeguards us from DB access via User::loadOptions(). $wgUser = User::newFromId(0); $this->settings = $this->internalDefaults; foreach ($this->defaultVarNames as $var) { $this->settings[$var] = $GLOBALS[$var]; } $this->compiledDBs = array(); foreach (self::getDBTypes() as $type) { $installer = $this->getDBInstaller($type); if (!$installer->isCompiled()) { continue; } $this->compiledDBs[] = $type; } $this->parserTitle = Title::newFromText('Installer'); $this->parserOptions = new ParserOptions(); // language will be wrong :( $this->parserOptions->setEditSection(false); }