* @file
* @ingroup Deployment
*/
+
+use MediaWiki\Interwiki\NullInterwikiLookup;
use MediaWiki\MediaWikiServices;
use MediaWiki\Shell\Shell;
$installerConfig = self::getInstallerConfig( $defaultConfig );
// Reset all services and inject config overrides
- MediaWiki\MediaWikiServices::resetGlobalInstance( $installerConfig );
+ MediaWikiServices::resetGlobalInstance( $installerConfig );
// Don't attempt to load user language options (T126177)
// This will be overridden in the web installer with the user-specified language
Language::getLocalisationCache()->disableBackend();
// Disable all global services, since we don't have any configuration yet!
- MediaWiki\MediaWikiServices::disableStorageBackend();
+ MediaWikiServices::disableStorageBackend();
+ $mwServices = MediaWikiServices::getInstance();
// Disable object cache (otherwise CACHE_ANYTHING will try CACHE_DB and
// SqlBagOStuff will then throw since we just disabled wfGetDB)
- $wgObjectCaches = MediaWikiServices::getInstance()->getMainConfig()->get( 'ObjectCaches' );
+ $wgObjectCaches = $mwServices->getMainConfig()->get( 'ObjectCaches' );
$wgMemc = ObjectCache::getInstance( CACHE_NONE );
+ // Disable interwiki lookup, to avoid database access during parses
+ $mwServices->redefineService( 'InterwikiLookup', function () {
+ return new NullInterwikiLookup();
+ } );
+
// Having a user with id = 0 safeguards us from DB access via User::loadOptions().
$wgUser = User::newFromId( 0 );
RequestContext::getMain()->setUser( $wgUser );
* Installer variables are typically prefixed by an underscore.
*
* @param string $name
- * @param mixed $default
+ * @param mixed|null $default
*
* @return mixed
*/
protected function doGenerateKeys( $keys ) {
$status = Status::newGood();
- $strong = true;
foreach ( $keys as $name => $length ) {
- $secretKey = MWCryptRand::generateHex( $length, true );
- if ( !MWCryptRand::wasStrong() ) {
- $strong = false;
- }
-
+ $secretKey = MWCryptRand::generateHex( $length );
$this->setVar( $name, $secretKey );
}
- if ( !$strong ) {
- $names = array_keys( $keys );
- $names = preg_replace( '/^(.*)$/', '\$$1', $names );
- global $wgLang;
- $status->warning( 'config-insecure-keys', $wgLang->listToText( $names ), count( $names ) );
- }
-
return $status;
}
/**
- * Create the first user account, grant it sysop and bureaucrat rights
+ * Create the first user account, grant it sysop, bureaucrat and interface-admin rights
*
* @return Status
*/
$user->addGroup( 'sysop' );
$user->addGroup( 'bureaucrat' );
+ $user->addGroup( 'interface-admin' );
if ( $this->getVar( '_AdminEmail' ) ) {
$user->setEmail( $this->getVar( '_AdminEmail' ) );
}
$GLOBALS['wgLanguageConverterCacheType'] = CACHE_NONE;
// Debug-friendly
$GLOBALS['wgShowExceptionDetails'] = true;
+ $GLOBALS['wgShowHostnames'] = true;
// Don't break forms
$GLOBALS['wgExternalLinkTarget'] = '_blank';
- // Extended debugging
- $GLOBALS['wgShowSQLErrors'] = true;
- $GLOBALS['wgShowDBErrorBacktrace'] = true;
-
// Allow multiple ob_flush() calls
$GLOBALS['wgDisableOutputCompression'] = true;