command('inspire') // ->hourly(); } /** * Register the commands for the application. * * @return void */ protected function commands() { require base_path('routes/console.php'); } /** * Run the console application. * * @param \Symfony\Component\Console\Input\InputInterface $input input * @param \Symfony\Component\Console\Output\OutputInterface $output output * @return int */ public function handle($input, $output = null) { $command = $input->getFirstArgument(); if (in_array($command, $this->skipXECommands)) { $this->skipXE = true; } return parent::handle($input, $output); } /** * Bootstrap the application for artisan commands. * * @return void */ public function bootstrap() { $args = func_get_args(); $withXE = array_shift($args); if (!$this->isInstalled() && $withXE !== true) { $this->resetForFramework(); } elseif ($this->skipXE !== false) { // without xe $this->resetForFramework(); } parent::bootstrap(); } /** * check xe installed * * @return bool */ protected function isInstalled() { return file_exists(app()->getInstalledPath()); } /** * Redefine providers and command for framework activation. * * @return void */ protected function resetForFramework() { $this->resetProviders(); $this->setCommandBeforeInstall(); } /** * Define commands for previously installation * * @return void */ protected function setCommandBeforeInstall() { $this->commands = [Commands\XeInstall::class]; } }