Files

24 lines
627 B
PHP
Raw Permalink Normal View History

2026-10-05 18:10:18 -04:00
<?php
declare(strict_types=1);
namespace Pterodactyl\Services\Extensions;
2026-10-07 16:32:56 -04:00
use Illuminate\Contracts\Console\Kernel;
2026-10-05 18:10:18 -04:00
2026-10-07 16:32:56 -04:00
/**
* Runs what an administrator would after changing which extension code runs: route:clear,
* since cached routes hold the routes of the extensions enabled when they were cached, and
* queue:restart, so long-running workers boot with the new set.
*/
2026-10-05 18:10:18 -04:00
final readonly class ExtensionRuntimeRefresher
{
2026-10-07 16:32:56 -04:00
public function __construct(private Kernel $artisan) {}
2026-10-05 18:10:18 -04:00
public function refresh(): void
{
2026-10-07 16:32:56 -04:00
$this->artisan->call('route:clear');
$this->artisan->call('queue:restart');
2026-10-05 18:10:18 -04:00
}
}