public function handle()
{
// cache 가 활성화 되어있는 경우, 한번 읽은 파일은 한번의 요청처리 과정중
// 해당 파일을 변경하더라도 새로 읽지 않고 cache 된 파일내용을 이용하게 됨
// 설치 과정중 config 파일들이 생성된 후 오류 발생시 config 파일들이 남게 되고,
// 이 상태에서 재시도시 이전 파일이 읽혀지게되어 내용을 변경하였더라도 반영이 되지 않음
// cache disable 로 인해 성능이슈가 발생한다면 생성되었던 파일을 지우는 방식으로 변경
ini_set('opcache.enable', 0);
$noInteraction = $this->option('no-interaction');
$configFile = $this->option('config');
if ($configFile !== null && realpath($configFile) !== false) {
$this->configFile = realpath($configFile);
$config = Yaml::parse(file_get_contents($this->configFile));
if ($config !== null) {
$this->defaultInfos = array_merge($this->defaultInfos, $config);
}
// configFile 있을 경우에만 noInteraction 가능
$this->noInteraction = $noInteraction;
}
try {
$this->process();
$this->output->success('Install was completed successfully.');
} catch (\Exception $e) {
$this->output->error('Install fail!! Try again.');
$note = ['Check point for reinstall:', ' * remove [.env] file', ' * remove all table in your database'];
$this->output->note(implode(PHP_EOL, $note));
throw $e;
}
}