build admin for hr

This commit is contained in:
xiaomlove
2021-06-22 13:49:54 +08:00
parent 142e18bed0
commit cd5f1305e9
31 changed files with 46 additions and 36 deletions

View File

@@ -46,11 +46,11 @@ class Install
for ($i = 1; $i < $step; $i++) {
$progressKey = $this->getProgressKey($i);
if (!isset($_SESSION[$progressKey])) {
$this->doLog("check step: $i, session doesn't have, session: " . json_encode($_SESSION));
$this->doLog("check step: $i, session doesn't have" );
return false;
}
}
$this->doLog("check step: $step, can access, session: " . json_encode($_SESSION));
$this->doLog("check step: $step, can access" );
return true;
}
@@ -554,4 +554,20 @@ class Install
$this->doLog("[MIGRATE] success.");
}
}
public function runDatabaseSeeder()
{
if (!WITH_LARAVEL) {
throw new \RuntimeException('Laravel is not avaliable.');
}
$command = "php " . ROOT_PATH . "artisan db:seed";
$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("[DATABASE_SEED] success.");
}
}
}