Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Check result of database installation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwatzman committed Aug 31, 2015
1 parent 04c1637 commit bae147d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion base/DatabaseInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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},
).
Expand All @@ -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;
}

Expand Down

0 comments on commit bae147d

Please sign in to comment.