Merge "Add tests for API's assert={user|bot}"
[lhc/web/wiklou.git] / includes / installer / Installer.php
index 85717c5..88478f4 100644 (file)
@@ -170,7 +170,6 @@ abstract class Installer {
                'wgMetaNamespace',
                'wgDeletedDirectory',
                'wgEnableUploads',
-               'wgLogo',
                'wgShellLocale',
                'wgSecretKey',
                'wgUseInstantCommons',
@@ -211,6 +210,10 @@ abstract class Installer {
                '_MemCachedServers' => '',
                '_UpgradeKeySupplied' => false,
                '_ExistingDBSettings' => false,
+
+               // $wgLogo is probably wrong (bug 48084); set something that will work.
+               // Single quotes work fine here, as LocalSettingsGenerator outputs this unescaped.
+               'wgLogo' => '$wgStylePath/common/images/wiki.png',
        );
 
        /**
@@ -348,10 +351,23 @@ abstract class Installer {
        public function __construct() {
                global $wgMessagesDirs, $wgUser;
 
-               // Disable the i18n cache and LoadBalancer
+               // 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';
 
@@ -386,7 +402,7 @@ abstract class Installer {
                $this->compiledDBs = $compiledDBs;
 
                $this->parserTitle = Title::newFromText( 'Installer' );
-               $this->parserOptions = new ParserOptions; // language will  be wrong :(
+               $this->parserOptions = new ParserOptions; // language will be wrong :(
                $this->parserOptions->setEditSection( false );
        }