prepare beta12

This commit is contained in:
xiaomlove
2021-06-22 12:56:03 +08:00
parent c5326513a1
commit 142e18bed0
7 changed files with 43 additions and 22 deletions

View File

@@ -268,6 +268,7 @@ class Install
public function gotoStep($step)
{
nexus_redirect(getBaseUrl() . "?step=$step");
die(0);
}
public function maxStep()
@@ -537,4 +538,20 @@ class Install
}
return true;
}
public function runMigrate()
{
if (!WITH_LARAVEL) {
throw new \RuntimeException('Laravel is not avaliable.');
}
$command = "php " . ROOT_PATH . "artisan migrate --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));
if ($result_code != 0) {
throw new \RuntimeException(json_encode($output));
} else {
$this->doLog("[MIGRATE] success.");
}
}
}