Hard deprecate Parser::disableCache()
[lhc/web/wiklou.git] / maintenance / install.php
index 1dd1909..bf39fbd 100644 (file)
@@ -60,6 +60,12 @@ class CommandLineInstaller extends Maintenance {
                        false,
                        true
                );
+               $this->addOption(
+                       'server',
+                       'The base URL of the web server the wiki will be on (http://localhost)',
+                       false,
+                       true
+               );
 
                $this->addOption( 'lang', 'The language to use (en)', false, true );
                /* $this->addOption( 'cont-lang', 'The content language (en)', false, true ); */
@@ -115,7 +121,12 @@ class CommandLineInstaller extends Maintenance {
                        $this->setPassOption();
                }
 
-               $installer = InstallerOverrides::getCliInstaller( $siteName, $adminName, $this->mOptions );
+               try {
+                       $installer = InstallerOverrides::getCliInstaller( $siteName, $adminName, $this->mOptions );
+               } catch ( \MediaWiki\Installer\InstallException $e ) {
+                       $this->output( $e->getStatus()->getMessage( false, false, 'en' )->text() . "\n" );
+                       return false;
+               }
 
                $status = $installer->doEnvironmentChecks();
                if ( $status->isGood() ) {
@@ -123,17 +134,23 @@ class CommandLineInstaller extends Maintenance {
                } else {
                        $installer->showStatusMessage( $status );
 
-                       return;
+                       return false;
                }
                if ( !$envChecksOnly ) {
-                       $installer->execute();
+                       $status = $installer->execute();
+                       if ( !$status->isGood() ) {
+                               $installer->showStatusMessage( $status );
+
+                               return false;
+                       }
                        $installer->writeConfigurationFile( $this->getOption( 'confpath', $IP ) );
+                       $installer->showMessage(
+                               'config-install-success',
+                               $installer->getVar( 'wgServer' ),
+                               $installer->getVar( 'wgScriptPath' )
+                       );
                }
-               $installer->showMessage(
-                       'config-install-success',
-                       $installer->getVar( 'wgServer' ),
-                       $installer->getVar( 'wgScriptPath' )
-               );
+               return true;
        }
 
        private function setDbPassOption() {