Don't trigger MessageBlobStore during tests
[lhc/web/wiklou.git] / includes / installer / Installer.php
index 381f23c..c29b462 100644 (file)
@@ -186,7 +186,6 @@ abstract class Installer {
                'wgUseInstantCommons',
                'wgUpgradeKey',
                'wgDefaultSkin',
-               'wgResourceLoaderMaxQueryLength',
        );
 
        /**
@@ -285,15 +284,15 @@ abstract class Installer {
         */
        public $licenses = array(
                'cc-by' => array(
-                       'url' => 'http://creativecommons.org/licenses/by/3.0/',
+                       'url' => 'https://creativecommons.org/licenses/by/3.0/',
                        'icon' => '{$wgResourceBasePath}/resources/assets/licenses/cc-by.png',
                ),
                'cc-by-sa' => array(
-                       'url' => 'http://creativecommons.org/licenses/by-sa/3.0/',
+                       'url' => 'https://creativecommons.org/licenses/by-sa/3.0/',
                        'icon' => '{$wgResourceBasePath}/resources/assets/licenses/cc-by-sa.png',
                ),
                'cc-by-nc-sa' => array(
-                       'url' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/',
+                       'url' => 'https://creativecommons.org/licenses/by-nc-sa/3.0/',
                        'icon' => '{$wgResourceBasePath}/resources/assets/licenses/cc-by-nc-sa.png',
                ),
                'cc-0' => array(
@@ -305,7 +304,7 @@ abstract class Installer {
                        'icon' => '{$wgResourceBasePath}/resources/assets/licenses/public-domain.png',
                ),
                'gfdl' => array(
-                       'url' => 'http://www.gnu.org/copyleft/fdl.html',
+                       'url' => 'https://www.gnu.org/copyleft/fdl.html',
                        'icon' => '{$wgResourceBasePath}/resources/assets/licenses/gnu-fdl.png',
                ),
                'none' => array(
@@ -727,7 +726,7 @@ abstract class Installer {
                }
                $databases = array_flip( $databases );
                if ( !$databases ) {
-                       $this->showError( 'config-no-db', $wgLang->commaList( $allNames ) );
+                       $this->showError( 'config-no-db', $wgLang->commaList( $allNames ), count( $allNames ) );
 
                        // @todo FIXME: This only works for the web installer!
                        return false;
@@ -1376,8 +1375,8 @@ abstract class Installer {
                                }
 
                                try {
-                                       $text = Http::get( $url . $file, array( 'timeout' => 3 ) );
-                               } catch ( MWException $e ) {
+                                       $text = Http::get( $url . $file, array( 'timeout' => 3 ), __METHOD__ );
+                               } catch ( Exception $e ) {
                                        // Http::get throws with allow_url_fopen = false and no curl extension.
                                        $text = null;
                                }
@@ -1469,15 +1468,16 @@ abstract class Installer {
        }
 
        /**
-        * Returns a default value to be used for $wgDefaultSkin: the preferred skin, if available among
-        * the installed skins, or any other one otherwise.
+        * Returns a default value to be used for $wgDefaultSkin: normally the one set in DefaultSettings,
+        * but will fall back to another if the default skin is missing and some other one is present
+        * instead.
         *
         * @param string[] $skinNames Names of installed skins.
         * @return string
         */
        public function getDefaultSkin( array $skinNames ) {
                $defaultSkin = $GLOBALS['wgDefaultSkin'];
-               if ( in_array( $defaultSkin, $skinNames ) ) {
+               if ( !$skinNames || in_array( $defaultSkin, $skinNames ) ) {
                        return $defaultSkin;
                } else {
                        return $skinNames[0];
@@ -1723,7 +1723,7 @@ abstract class Installer {
 
                if ( MWHttpRequest::canMakeRequests() ) {
                        $res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl,
-                               array( 'method' => 'POST', 'postData' => $params ) )->execute();
+                               array( 'method' => 'POST', 'postData' => $params ), __METHOD__ )->execute();
                        if ( !$res->isOK() ) {
                                $s->warning( 'config-install-subscribe-fail', $res->getMessage() );
                        }
@@ -1753,7 +1753,7 @@ abstract class Installer {
                                false,
                                User::newFromName( 'MediaWiki default' )
                        );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        //using raw, because $wgShowExceptionDetails can not be set yet
                        $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
                }