/**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     parent::fire();
     try {
         if (!cmsinstalled()) {
             throw new \Exception('The CMS is not installed!');
         }
         $password = Str::random(8);
         $this->r_installer->addUserAdmin(['civility' => $this->argument('user-civility'), 'first_name' => $this->argument('user-first-name'), 'last_name' => $this->argument('user-last-name'), 'email' => $this->argument('user-email'), 'password' => $password]);
         $this->line('<comment>Password associated to ' . $this->argument('user-email') . ' : ' . $password . '</comment>');
         $this->line('<comment>Do not forget to change this password after your first connection!</comment>');
     } catch (InvalidArgumentException $e) {
         $this->error($e->getMessage());
     } catch (\Exception $e) {
         $this->error($e->getMessage());
     }
 }
 /**
  * Step 3
  *
  * Run post migration and configuration actions
  *
  * - add admin user and roles
  *
  * @return Redirect
  */
 public function initialiseProduction(Request $request)
 {
     try {
         // Retrieve data from the session
         $session_installer = $request->session()->get('installer_user_admin');
         // Reset session
         $request->session()->put('installer_user_admin', []);
         $this->r_installer->addUserAdmin($session_installer);
         // xABE todo : Add first Page and first Post (with category)
         $this->r_installer->set_env_as_production();
     } catch (FileException $exception) {
         $this->r_installer->revert_env_to_installer();
         // Todo : write message
         return Redirect::to('installer')->withErrors('installer::installer.error:')->withInput();
     }
     return redirect('/');
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     parent::fire();
     try {
         if (cmsinstalled()) {
             throw new \Exception('The CMS is already installed!');
         }
         $success = $this->r_installer->testDBConnection($this->argument('db-host'), $this->argument('db-name'), $this->argument('db-username'), $this->argument('db-password'));
         if ($success) {
             $this->r_installer->generateConfigs($this->argument('site-name'), $this->argument('site-description'), $this->argument('site-url'), $this->argument('db-host'), $this->argument('db-name'), $this->argument('db-username'), $this->argument('db-password'), $this->argument('user-first-name'), $this->argument('user-last-name'), $this->argument('user-email'));
             $this->call('cache:clear');
             $this->r_installer->migrate(['APP_SITE_NAME' => $this->argument('site-name'), 'APP_URL' => $this->argument('site-url')], ['--force' => true, '--database' => 'installer'], ['--force' => true, '--database' => 'installer']);
             $password = Str::random(Settings::get('installer.password_length'));
             $this->r_installer->addUserAdmin(['civility' => $this->argument('user-civility'), 'first_name' => $this->argument('user-first-name'), 'last_name' => $this->argument('user-last-name'), 'email' => $this->argument('user-email'), 'password' => $password]);
             $this->r_installer->set_env_as_production();
             $this->line(sprintf(trans('installer::installer.command_line_show_password'), $this->argument('user-email'), $password));
             $this->line(trans('installer::installer.command_line_remember_change_password'));
         } else {
             $this->error(trans('installer::installer.error:db_connection'));
         }
     } catch (InvalidArgumentException $e) {
         $this->error($e->getMessage());
     } catch (\Exception $e) {
         $this->error($e->getMessage());
     }
 }
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     parent::fire();
     $this->r_installer->consoleInstallationProcess($this->getOutput(), $this->argument('db-host'), $this->argument('db-name'), $this->argument('db-username'), $this->argument('db-password'), $this->argument('site-name'), $this->argument('site-description'), $this->argument('site-url'), $this->argument('user-civility'), $this->argument('user-first-name'), $this->argument('user-last-name'), $this->argument('user-email'));
 }