Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -15,48 +15,22 @@ use Pterodactyl\Exceptions\Service\Node\ConfigurationNotPersistedException;
|
|||
class NodeUpdateService
|
||||
{
|
||||
/**
|
||||
* @var \Illuminate\Database\ConnectionInterface
|
||||
*/
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Repositories\Wings\DaemonConfigurationRepository
|
||||
*/
|
||||
private $configurationRepository;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Contracts\Encryption\Encrypter
|
||||
*/
|
||||
private $encrypter;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Repositories\Eloquent\NodeRepository
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* UpdateService constructor.
|
||||
* NodeUpdateService constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $connection,
|
||||
Encrypter $encrypter,
|
||||
DaemonConfigurationRepository $configurationRepository,
|
||||
NodeRepository $repository
|
||||
private ConnectionInterface $connection,
|
||||
private DaemonConfigurationRepository $configurationRepository,
|
||||
private Encrypter $encrypter,
|
||||
private NodeRepository $repository
|
||||
) {
|
||||
$this->connection = $connection;
|
||||
$this->configurationRepository = $configurationRepository;
|
||||
$this->encrypter = $encrypter;
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the configuration values for a given node on the machine.
|
||||
*
|
||||
* @return \Pterodactyl\Models\Node
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function handle(Node $node, array $data, bool $resetToken = false)
|
||||
public function handle(Node $node, array $data, bool $resetToken = false): Node
|
||||
{
|
||||
if ($resetToken) {
|
||||
$data['daemon_token'] = $this->encrypter->encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH));
|
||||
|
@ -87,7 +61,7 @@ class NodeUpdateService
|
|||
// but something went wrong with Wings we just want to store the update and let the user manually
|
||||
// make changes as needed.
|
||||
//
|
||||
// This avoids issues with proxies such as CloudFlare which will see Wings as offline and then
|
||||
// This avoids issues with proxies such as Cloudflare which will see Wings as offline and then
|
||||
// inject their own response pages, causing this logic to get fucked up.
|
||||
//
|
||||
// @see https://github.com/pterodactyl/panel/issues/2712
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue