Merge "Follow-up e3da2e23: Fix typo in hideanons filter name"
[lhc/web/wiklou.git] / includes / installer / Installer.php
index 9dc8032..9c87cf0 100644 (file)
@@ -1421,6 +1421,7 @@ abstract class Installer {
                $wgAutoloadClasses += $data['autoload'];
 
                $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ?
+                       /** @suppress PhanUndeclaredVariable $wgHooks is set by DefaultSettings */
                        $wgHooks['LoadExtensionSchemaUpdates'] : [];
 
                if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
@@ -1655,8 +1656,13 @@ abstract class Installer {
         */
        protected function createMainpage( DatabaseInstaller $installer ) {
                $status = Status::newGood();
+               $title = Title::newMainPage();
+               if ( $title->exists() ) {
+                       $status->warning( 'config-install-mainpage-exists' );
+                       return $status;
+               }
                try {
-                       $page = WikiPage::factory( Title::newMainPage() );
+                       $page = WikiPage::factory( $title );
                        $content = new WikitextContent(
                                wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
                                wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text()