Skip to content

Commit 1d38b4f

Browse files
authored
Laravel 10 (pterodactyl#4706)
1 parent ad4ddc6 commit 1d38b4f

File tree

136 files changed

+1790
-2063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1790
-2063
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
php: [8.0, 8.1]
20+
php: [8.1, 8.2]
2121
database: ["mariadb:10.2", "mysql:8"]
2222
services:
2323
database:

app/Console/Commands/Environment/AppSettingsCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Pterodactyl\Console\Commands\Environment;
44

5-
use DateTimeZone;
65
use Illuminate\Console\Command;
76
use Illuminate\Contracts\Console\Kernel;
87
use Pterodactyl\Traits\Commands\EnvironmentWriterTrait;
@@ -89,7 +88,7 @@ public function handle(): int
8988
$this->output->comment('The timezone should match one of PHP\'s supported timezones. If you are unsure, please reference https://php.net/manual/en/timezones.php.');
9089
$this->variables['APP_TIMEZONE'] = $this->option('timezone') ?? $this->anticipate(
9190
'Application Timezone',
92-
DateTimeZone::listIdentifiers(),
91+
\DateTimeZone::listIdentifiers(),
9392
config('app.timezone')
9493
);
9594

app/Console/Commands/Environment/DatabaseSettingsCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Pterodactyl\Console\Commands\Environment;
44

5-
use PDOException;
65
use Illuminate\Console\Command;
76
use Illuminate\Contracts\Console\Kernel;
87
use Illuminate\Database\DatabaseManager;
@@ -72,7 +71,7 @@ public function handle(): int
7271

7372
try {
7473
$this->testMySQLConnection();
75-
} catch (PDOException $exception) {
74+
} catch (\PDOException $exception) {
7675
$this->output->error(sprintf('Unable to connect to the MySQL server using the provided credentials. The error returned was "%s".', $exception->getMessage()));
7776
$this->output->error('Your connection credentials have NOT been saved. You will need to provide valid connection information before proceeding.');
7877

app/Console/Commands/Maintenance/CleanServiceBackupFilesCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Pterodactyl\Console\Commands\Maintenance;
44

5-
use SplFileInfo;
65
use Carbon\Carbon;
76
use Illuminate\Console\Command;
87
use Illuminate\Contracts\Filesystem\Filesystem;
@@ -35,7 +34,7 @@ public function handle()
3534
{
3635
$files = $this->disk->files('services/.bak');
3736

38-
collect($files)->each(function (SplFileInfo $file) {
37+
collect($files)->each(function (\SplFileInfo $file) {
3938
$lastModified = Carbon::createFromTimestamp($this->disk->lastModified($file->getPath()));
4039
if ($lastModified->diffInMinutes(Carbon::now()) > self::BACKUP_THRESHOLD_MINUTES) {
4140
$this->disk->delete($file->getPath());

app/Console/Commands/Maintenance/PruneOrphanedBackupsCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Pterodactyl\Console\Commands\Maintenance;
44

55
use Carbon\CarbonImmutable;
6-
use InvalidArgumentException;
76
use Illuminate\Console\Command;
87
use Pterodactyl\Repositories\Eloquent\BackupRepository;
98

@@ -25,7 +24,7 @@ public function handle()
2524
{
2625
$since = $this->option('prune-age') ?? config('backups.prune_age', 360);
2726
if (!$since || !is_digit($since)) {
28-
throw new InvalidArgumentException('The "--prune-age" argument must be a value greater than 0.');
27+
throw new \InvalidArgumentException('The "--prune-age" argument must be a value greater than 0.');
2928
}
3029

3130
$query = $this->backupRepository->getBuilder()

app/Console/Commands/Schedule/ProcessRunnableCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Pterodactyl\Console\Commands\Schedule;
44

55
use Exception;
6-
use Throwable;
76
use Illuminate\Console\Command;
87
use Pterodactyl\Models\Schedule;
98
use Illuminate\Support\Facades\Log;
@@ -68,7 +67,7 @@ protected function processSchedule(Schedule $schedule)
6867
'schedule' => $schedule->name,
6968
'hash' => $schedule->hashid,
7069
]));
71-
} catch (Throwable|Exception $exception) {
70+
} catch (\Throwable|\Exception $exception) {
7271
Log::error($exception, ['schedule_id' => $schedule->id]);
7372

7473
$this->error("An error was encountered while processing Schedule #$schedule->id: " . $exception->getMessage());

app/Console/Commands/UpgradeCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Pterodactyl\Console\Commands;
44

5-
use Closure;
65
use Illuminate\Console\Command;
76
use Pterodactyl\Console\Kernel;
87
use Symfony\Component\Process\Process;
@@ -177,7 +176,7 @@ public function handle()
177176
$this->info('Panel has been successfully upgraded. Please ensure you also update any Wings instances: https://pterodactyl.io/wings/1.0/upgrading.html');
178177
}
179178

180-
protected function withProgress(ProgressBar $bar, Closure $callback)
179+
protected function withProgress(ProgressBar $bar, \Closure $callback)
181180
{
182181
$bar->clear();
183182
$callback();

app/Console/Kernel.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ class Kernel extends ConsoleKernel
1818
/**
1919
* Register the commands for the application.
2020
*/
21-
protected function commands()
21+
protected function commands(): void
2222
{
2323
$this->load(__DIR__ . '/Commands');
2424
}
2525

2626
/**
2727
* Define the application's command schedule.
2828
*/
29-
protected function schedule(Schedule $schedule)
29+
protected function schedule(Schedule $schedule): void
3030
{
31+
// https://laravel.com/docs/10.x/upgrade#redis-cache-tags
32+
$schedule->command('cache:prune-stale-tags')->hourly();
33+
3134
// Execute scheduled commands for servers every minute, as if there was a normal cron running.
3235
$schedule->command(ProcessRunnableCommand::class)->everyMinute()->withoutOverlapping();
3336
$schedule->command(CleanServiceBackupFilesCommand::class)->daily();

app/Exceptions/AccountNotFoundException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Pterodactyl\Exceptions;
44

5-
use Exception;
6-
7-
class AccountNotFoundException extends Exception
5+
class AccountNotFoundException extends \Exception
86
{
97
}

app/Exceptions/AutoDeploymentException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Pterodactyl\Exceptions;
44

5-
use Exception;
6-
7-
class AutoDeploymentException extends Exception
5+
class AutoDeploymentException extends \Exception
86
{
97
}

0 commit comments

Comments
 (0)