Skip to content

Commit fa9431c

Browse files
committed
Slightly cleanup
1 parent 07798b7 commit fa9431c

File tree

8 files changed

+16
-191
lines changed

8 files changed

+16
-191
lines changed

app/Console/Commands/Maintenance/PruneOrphanedBackupsCommand.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PruneOrphanedBackupsCommand extends Command
1212
/**
1313
* @var string
1414
*/
15-
protected $signature = 'p:maintenance:prune-backups {--since-minutes=30}';
15+
protected $signature = 'p:maintenance:prune-backups {--prune-age=}';
1616

1717
/**
1818
* @var string
@@ -21,9 +21,9 @@ class PruneOrphanedBackupsCommand extends Command
2121

2222
public function handle(BackupRepository $repository)
2323
{
24-
$since = $this->option('since-minutes');
25-
if (!is_digit($since)) {
26-
throw new InvalidArgumentException('The --since-minutes option must be a valid numeric digit.');
24+
$since = $this->option('prune-age') ?? config('backups.prune_age', 360);
25+
if (!$since || !is_digit($since)) {
26+
throw new InvalidArgumentException('The "--prune-age" argument must be a value greater than 0.');
2727
}
2828

2929
$query = $repository->getBuilder()

app/Console/Commands/Migration/CleanOrphanedApiKeysCommand.php

-57
This file was deleted.

app/Console/Commands/Overrides/KeyGenerateCommand.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class KeyGenerateCommand extends BaseKeyGenerateCommand
1313
public function handle()
1414
{
1515
if (!empty(config('app.key')) && $this->input->isInteractive()) {
16-
$this->output->warning(trans('command/messages.key.warning'));
17-
if (!$this->confirm(trans('command/messages.key.confirm'))) {
16+
$this->output->warning('It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.');
17+
if (!$this->confirm('I understand the consequences of performing this command and accept all responsibility for the loss of encrypted data.')) {
1818
return;
1919
}
2020

21-
if (!$this->confirm(trans('command/messages.key.final_confirm'))) {
21+
if (!$this->confirm('Are you sure you wish to continue? Changing the application encryption key WILL CAUSE DATA LOSS.')) {
2222
return;
2323
}
2424
}

app/Console/Commands/Overrides/SeedCommand.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ class SeedCommand extends BaseSeedCommand
1010
use RequiresDatabaseMigrations;
1111

1212
/**
13-
* Block someone from running this seed command if they have not completed the migration
14-
* process.
15-
*
16-
* @return int
13+
* Block someone from running this seed command if they have not completed
14+
* the migration process.
1715
*/
18-
public function handle()
16+
public function handle(): int
1917
{
2018
if (!$this->hasCompletedMigrations()) {
2119
return $this->showMigrationWarning();

app/Console/Commands/Overrides/UpCommand.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ class UpCommand extends BaseUpCommand
1010
use RequiresDatabaseMigrations;
1111

1212
/**
13-
* @return bool|int
13+
* Block someone from running this up command if they have not completed
14+
* the migration process.
1415
*/
15-
public function handle()
16+
public function handle(): int
1617
{
1718
if (!$this->hasCompletedMigrations()) {
1819
return $this->showMigrationWarning();

app/Console/Commands/Server/BulkReinstallActionCommand.php

-109
This file was deleted.

app/Console/Kernel.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ protected function schedule(Schedule $schedule)
2323
// Execute scheduled commands for servers every minute, as if there was a normal cron running.
2424
$schedule->command('p:schedule:process')->everyMinute()->withoutOverlapping();
2525

26-
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted.
27-
$pruneAge = config('backups.prune_age', 360); // Defaults to 6 hours (time is in minuteS)
28-
if ($pruneAge > 0) {
29-
$schedule->command('p:maintenance:prune-backups', [
30-
'--since-minutes' => $pruneAge,
31-
])->everyThirtyMinutes();
26+
if (config('backups.prune_age')) {
27+
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted.
28+
$schedule->command('p:maintenance:prune-backups')->everyThirtyMinutes();
3229
}
3330

3431
// Every day cleanup any internal backups of service files.

resources/lang/en/command/messages.php

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<?php
22

33
return [
4-
'key' => [
5-
'warning' => 'It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.',
6-
'confirm' => 'I understand the consequences of performing this command and accept all responsibility for the loss of encrypted data.',
7-
'final_confirm' => 'Are you sure you wish to continue? Changing the application encryption key WILL CAUSE DATA LOSS.',
8-
],
94
'location' => [
105
'no_location_found' => 'Could not locate a record matching the provided short code.',
116
'ask_short' => 'Location Short Code',

0 commit comments

Comments
 (0)