App\Console\Commands\XeUpdate::fire PHP Method

fire() public method

Execute the console command.
public fire ( ComposerFileWriter $writer, InterceptionHandler $interceptionHandler ) : boolean | null
$writer Xpressengine\Plugin\Composer\ComposerFileWriter
$interceptionHandler Xpressengine\Interception\InterceptionHandler
return boolean | null
    public function fire(ComposerFileWriter $writer, InterceptionHandler $interceptionHandler)
    {
        // php artisan xe:update [version] [--skip-download]
        // title
        // Xpressengine을 업데이트합니다.
        $this->output->block('Updating Xpressengine.');
        // check option
        if (!$this->option('skip-download')) {
            // 업데이트 파일의 다운로드는 아직 지원하지 않습니다. 아래의 안내대로 코어를 업데이트 하십시오.
            $this->output->caution('Downloading update files does not yet supported. Follow the guide below for update.');
            $this->printGuide();
            return null;
        }
        // version 안내
        $installedVersion = trim(file_get_contents(storage_path('app/installed')));
        //  업데이트 버전 정보:
        $this->warn(' Version information:');
        $this->output->text("  {$installedVersion} -> " . __XE_VERSION__);
        // confirm
        if ($this->confirm("The Xpressengine ver." . __XE_VERSION__ . " will be updated. It may take up to a few minutes. \r\nDo you want to update?") === false) {
            //return;
        }
        // 플러그인 업데이트 잠금
        $writer->reset()->write();
        // composer update실행(composer update --no-dev)
        if (!$this->option('skip-composer')) {
            $this->output->section('Composer update command is running.. It may take up to a few minutes.');
            $this->line(" composer update");
            try {
                $this->runComposer(base_path(), "update");
            } catch (\Exception $e) {
            }
        }
        // migration
        $this->output->section('Running migration..');
        $this->migrateCore($installedVersion, __XE_VERSION__);
        // clear proxy
        $interceptionHandler->clearProxies();
        // mark installed
        $this->markInstalled();
        $this->output->success("Update the Xpressengine to ver." . __XE_VERSION__ . ".");
    }