X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_user_edit%27%2C%20iduser=user.userid%29%20%7D%7D?a=blobdiff_plain;f=maintenance%2Finstall.php;h=20254b0c05e93c3c747fc80a6cb69ee281fae78e;hb=1eb5d8e44d7f0476a3f85b3f7e15d7f2cbc51f9e;hp=1dd19094976773245fb112f41b25a38c6ae6d2ec;hpb=ee09d4f0ee2e592e721f00805735afcb9e3e7e22;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/install.php b/maintenance/install.php index 1dd1909497..20254b0c05 100644 --- a/maintenance/install.php +++ b/maintenance/install.php @@ -115,7 +115,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 +128,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() {