diff --git a/Changelog b/Changelog index 95351c318..cbbc3e236 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2019-03-03 DariusIII + * Chg: Update console commands 2019-03-02 DariusIII * Chg: Update code style on AniDB processing class * Chg: Update code style of adult processing classes diff --git a/app/Console/Commands/InstallNntmux.php b/app/Console/Commands/InstallNntmux.php index 998e11788..5d8e0eeee 100644 --- a/app/Console/Commands/InstallNntmux.php +++ b/app/Console/Commands/InstallNntmux.php @@ -73,9 +73,9 @@ class InstallNntmux extends Command } $this->info('Migrating tables and seeding them with initial data'); if (config('app.env') !== 'production') { - $this->call('migrate:fresh', ['--seed' => true]); + $this->call('migrate:fresh --seed'); } else { - $this->call('migrate:fresh', ['--force' => true, '--seed' => true]); + $this->call('migrate:fresh --force --seed'); } $paths = $this->updatePaths(); @@ -93,7 +93,7 @@ class InstallNntmux extends Command if (! $error && $this->addAdminUser()) { File::put(base_path().'/_install/install.lock', 'application install locked on '.now()); $this->info('Generating application key'); - $this->call('key:generate', ['--force' => true]); + $this->call('key:generate --force'); $this->info('NNTmux installation completed successfully'); exit(); } @@ -166,7 +166,7 @@ class InstallNntmux extends Command $this->info('Adding admin user to database'); try { User::add(config('nntmux.admin_username'), config('nntmux.admin_password'), config('nntmux.admin_email'), 2, '', '', '', ''); - User::where('username', config('nntmux.admin_username'))->update(['verified' => 1]); + User::where('username', config('nntmux.admin_username'))->update(['verified' => 1, 'email_verified_at' => now()]); } catch (\Throwable $e) { echo $e->getMessage(); $this->error('Unable to add admin user!'); diff --git a/app/Console/Commands/NntmuxResetTruncate.php b/app/Console/Commands/NntmuxResetTruncate.php index ac42d7383..969351ec0 100644 --- a/app/Console/Commands/NntmuxResetTruncate.php +++ b/app/Console/Commands/NntmuxResetTruncate.php @@ -14,15 +14,14 @@ class NntmuxResetTruncate extends Command * * @var string */ - protected $signature = 'nntmux:reset-truncate {type}'; + protected $signature = 'nntmux:reset-truncate'; /** * The console command description. * * @var string */ - protected $description = 'This command removes releases with no NZBs, resets all groups, truncates or drops(tpg) - article tables. All other releases are left alone.'; + protected $description = 'This command removes releases with no NZBs, resets all groups, truncates article tables. All other releases are left alone.'; /** * Create a new command instance. diff --git a/app/Console/Commands/UpdateNNTmux.php b/app/Console/Commands/UpdateNNTmux.php index 80a599184..fdacd6c6f 100644 --- a/app/Console/Commands/UpdateNNTmux.php +++ b/app/Console/Commands/UpdateNNTmux.php @@ -44,7 +44,7 @@ class UpdateNNTmux extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { $maintenance = $this->appDown(); $running = $this->stopTmux(); @@ -78,7 +78,7 @@ class UpdateNNTmux extends Command } if ($maintenance === true) { - $this->appUp(); + $this->call('up'); } if ($running === true) { $this->startTmux(); @@ -88,9 +88,9 @@ class UpdateNNTmux extends Command /** * @return bool */ - private function appDown() + private function appDown(): bool { - if (App::isDownForMaintenance() === false) { + if ($this->appDown() === false) { $this->call('down'); return true; @@ -99,18 +99,13 @@ class UpdateNNTmux extends Command return false; } - private function appUp() - { - $this->call('up'); - } - /** * @return bool */ - private function stopTmux() + private function stopTmux(): bool { if ((new Tmux())->isRunning() === true) { - $this->call('tmux-ui:stop', ['--kill' => true]); + $this->call('tmux-ui:stop --kill'); return true; } @@ -118,7 +113,7 @@ class UpdateNNTmux extends Command return false; } - private function startTmux() + private function startTmux(): void { $this->call('tmux-ui:start'); } diff --git a/app/Console/Commands/UpdateNNTmuxDB.php b/app/Console/Commands/UpdateNNTmuxDB.php index 947f428ce..b587b4749 100644 --- a/app/Console/Commands/UpdateNNTmuxDB.php +++ b/app/Console/Commands/UpdateNNTmuxDB.php @@ -35,7 +35,7 @@ class UpdateNNTmuxDB extends Command if (config('app.env') !== 'production') { $this->call('migrate'); } else { - $this->call('migrate', ['--force' => true]); + $this->call('migrate --force=true'); } } } diff --git a/app/Console/Commands/UpdateNNTmuxGit.php b/app/Console/Commands/UpdateNNTmuxGit.php index 510c6b648..c61658cc6 100644 --- a/app/Console/Commands/UpdateNNTmuxGit.php +++ b/app/Console/Commands/UpdateNNTmuxGit.php @@ -46,7 +46,7 @@ class UpdateNNTmuxGit extends Command if ((new Tmux())->isRunning() === true) { $wasRunning = true; - $this->call('tmux-ui:stop', ['--kill' => true]); + $this->call('tmux-ui:stop --kill'); } $this->info('Getting changes from Github'); $result = $this->git->gitPull();