improve update

This commit is contained in:
xiaomlove
2022-02-10 22:30:26 +08:00
parent c4697a7d89
commit 186bebfe12
8 changed files with 49 additions and 32 deletions
+7 -2
View File
@@ -539,12 +539,17 @@ class Install
return true;
}
public function runMigrate()
public function runMigrate($path = null)
{
if (!WITH_LARAVEL) {
throw new \RuntimeException('Laravel is not available.');
}
$command = "php " . ROOT_PATH . "artisan migrate --force";
$command = "php " . ROOT_PATH . "artisan migrate";
if (!is_null($path)) {
$command .= " --path=$path";
} else {
$command .= " --force";
}
$result = exec($command, $output, $result_code);
$this->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result));
$this->doLog("output: " . json_encode($output));