X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Finstaller%2FInstaller.php;h=abf4de4f692b92a3fa13071fc0efd93919b50a36;hp=4b6e8ccd488b94ff8837a9b784e5150dfe2f5ac5;hb=49aa4d3f9c48bced2e7293925786479a99b56b33;hpb=30d58769ac54f8ef3f0c54558f43b9a73a68b37e diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 4b6e8ccd48..abf4de4f69 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -23,6 +23,8 @@ * @file * @ingroup Deployment */ + +use MediaWiki\Interwiki\NullInterwikiLookup; use MediaWiki\MediaWikiServices; use MediaWiki\Shell\Shell; @@ -404,7 +406,7 @@ abstract class Installer { $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 @@ -415,13 +417,19 @@ abstract class Installer { 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 );