X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2Finstall.php;h=16b8ccf837ce350cf0bf9cccd22b4d6acd3eb1bf;hp=1dd19094976773245fb112f41b25a38c6ae6d2ec;hb=f1f9006707a2324505a9d97b32f07bf5a28aa37e;hpb=07746007177c008e4351f9e55a56536fecca6f0f;ds=sidebyside diff --git a/maintenance/install.php b/maintenance/install.php index 1dd1909497..16b8ccf837 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()->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() {