Merge branch 'release/v1.11.4' into release/v1.11.3
This commit is contained in:
commit
40dd354b18
155 changed files with 2390 additions and 2080 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Console\Commands\Environment;
|
||||
|
||||
use DateTimeZone;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Pterodactyl\Traits\Commands\EnvironmentWriterTrait;
|
||||
|
@ -89,7 +88,7 @@ class AppSettingsCommand extends Command
|
|||
$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.');
|
||||
$this->variables['APP_TIMEZONE'] = $this->option('timezone') ?? $this->anticipate(
|
||||
'Application Timezone',
|
||||
DateTimeZone::listIdentifiers(),
|
||||
\DateTimeZone::listIdentifiers(),
|
||||
config('app.timezone')
|
||||
);
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Console\Commands\Environment;
|
||||
|
||||
use PDOException;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Illuminate\Database\DatabaseManager;
|
||||
|
@ -72,7 +71,7 @@ class DatabaseSettingsCommand extends Command
|
|||
|
||||
try {
|
||||
$this->testMySQLConnection();
|
||||
} catch (PDOException $exception) {
|
||||
} catch (\PDOException $exception) {
|
||||
$this->output->error(sprintf('Unable to connect to the MySQL server using the provided credentials. The error returned was "%s".', $exception->getMessage()));
|
||||
$this->output->error('Your connection credentials have NOT been saved. You will need to provide valid connection information before proceeding.');
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class EmailSettingsCommand extends Command
|
|||
trans('command/messages.environment.mail.ask_driver'),
|
||||
[
|
||||
'smtp' => 'SMTP Server',
|
||||
'mail' => 'PHP\'s Internal Mail Function',
|
||||
'sendmail' => 'sendmail Binary',
|
||||
'mailgun' => 'Mailgun Transactional Email',
|
||||
'mandrill' => 'Mandrill Transactional Email',
|
||||
'postmark' => 'Postmark Transactional Email',
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Console\Commands\Maintenance;
|
||||
|
||||
use SplFileInfo;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Filesystem\Filesystem;
|
||||
|
@ -35,7 +34,7 @@ class CleanServiceBackupFilesCommand extends Command
|
|||
{
|
||||
$files = $this->disk->files('services/.bak');
|
||||
|
||||
collect($files)->each(function (SplFileInfo $file) {
|
||||
collect($files)->each(function (\SplFileInfo $file) {
|
||||
$lastModified = Carbon::createFromTimestamp($this->disk->lastModified($file->getPath()));
|
||||
if ($lastModified->diffInMinutes(Carbon::now()) > self::BACKUP_THRESHOLD_MINUTES) {
|
||||
$this->disk->delete($file->getPath());
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace Pterodactyl\Console\Commands\Maintenance;
|
||||
|
||||
use Carbon\CarbonImmutable;
|
||||
use InvalidArgumentException;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Repositories\Eloquent\BackupRepository;
|
||||
|
||||
|
@ -11,7 +10,7 @@ class PruneOrphanedBackupsCommand extends Command
|
|||
{
|
||||
protected $signature = 'p:maintenance:prune-backups {--prune-age=}';
|
||||
|
||||
protected $description = 'Marks all backups that have not completed in the last "n" minutes as being failed.';
|
||||
protected $description = 'Marks all backups older than "n" minutes that have not yet completed as being failed.';
|
||||
|
||||
/**
|
||||
* PruneOrphanedBackupsCommand constructor.
|
||||
|
@ -25,7 +24,7 @@ class PruneOrphanedBackupsCommand extends Command
|
|||
{
|
||||
$since = $this->option('prune-age') ?? config('backups.prune_age', 360);
|
||||
if (!$since || !is_digit($since)) {
|
||||
throw new InvalidArgumentException('The "--prune-age" argument must be a value greater than 0.');
|
||||
throw new \InvalidArgumentException('The "--prune-age" argument must be a value greater than 0.');
|
||||
}
|
||||
|
||||
$query = $this->backupRepository->getBuilder()
|
||||
|
@ -39,7 +38,7 @@ class PruneOrphanedBackupsCommand extends Command
|
|||
return;
|
||||
}
|
||||
|
||||
$this->warn("Marking $count backups that have not been marked as completed in the last $since minutes as failed.");
|
||||
$this->warn("Marking $count uncompleted backups that are older than $since minutes as failed.");
|
||||
|
||||
$query->update([
|
||||
'is_successful' => false,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace Pterodactyl\Console\Commands\Schedule;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Models\Schedule;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
@ -68,7 +67,7 @@ class ProcessRunnableCommand extends Command
|
|||
'schedule' => $schedule->name,
|
||||
'hash' => $schedule->hashid,
|
||||
]));
|
||||
} catch (Throwable|Exception $exception) {
|
||||
} catch (\Throwable|\Exception $exception) {
|
||||
Log::error($exception, ['schedule_id' => $schedule->id]);
|
||||
|
||||
$this->error("An error was encountered while processing Schedule #$schedule->id: " . $exception->getMessage());
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Console\Commands;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Console\Kernel;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
@ -177,7 +176,7 @@ class UpgradeCommand extends Command
|
|||
$this->info('Panel has been successfully upgraded. Please ensure you also update any Wings instances: https://pterodactyl.io/wings/1.0/upgrading.html');
|
||||
}
|
||||
|
||||
protected function withProgress(ProgressBar $bar, Closure $callback)
|
||||
protected function withProgress(ProgressBar $bar, \Closure $callback)
|
||||
{
|
||||
$bar->clear();
|
||||
$callback();
|
||||
|
|
|
@ -18,7 +18,7 @@ class Kernel extends ConsoleKernel
|
|||
/**
|
||||
* Register the commands for the application.
|
||||
*/
|
||||
protected function commands()
|
||||
protected function commands(): void
|
||||
{
|
||||
$this->load(__DIR__ . '/Commands');
|
||||
}
|
||||
|
@ -26,8 +26,11 @@ class Kernel extends ConsoleKernel
|
|||
/**
|
||||
* Define the application's command schedule.
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
// https://laravel.com/docs/10.x/upgrade#redis-cache-tags
|
||||
$schedule->command('cache:prune-stale-tags')->hourly();
|
||||
|
||||
// Execute scheduled commands for servers every minute, as if there was a normal cron running.
|
||||
$schedule->command(ProcessRunnableCommand::class)->everyMinute()->withoutOverlapping();
|
||||
$schedule->command(CleanServiceBackupFilesCommand::class)->daily();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue