diff --git a/base/DatabaseInstaller.php b/base/DatabaseInstaller.php index 82e0032..3c29521 100644 --- a/base/DatabaseInstaller.php +++ b/base/DatabaseInstaller.php @@ -59,7 +59,9 @@ public function installDatabase(): bool { $sed = 'sed s/MyISAM/InnoDB/g |'; } - shell_exec( + $output = null; + $ret = null; + exec( Utils::EscapeCommand( Vector {$this->options->dumpIsCompressed ? 'zcat' : 'cat', $dump}, ). @@ -68,7 +70,16 @@ public function installDatabase(): bool { Utils::EscapeCommand( Vector {'mysql', '-h', '127.0.0.1', $db, '-u', $db, '-p'.$db}, ), + $output, + $ret, ); + + if ($ret !== 0) { + throw new Exception( + 'Database installation failed: '.implode("\n", $output) + ); + } + return true; }