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
|
@ -1,11 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Extensions;
|
||||
|
||||
|
@ -20,44 +13,22 @@ class DynamicDatabaseConnection
|
|||
public const DB_COLLATION = 'utf8_unicode_ci';
|
||||
public const DB_DRIVER = 'mysql';
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Contracts\Encryption\Encrypter
|
||||
*/
|
||||
protected $encrypter;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface
|
||||
*/
|
||||
protected $repository;
|
||||
|
||||
/**
|
||||
* DynamicDatabaseConnection constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
ConfigRepository $config,
|
||||
DatabaseHostRepositoryInterface $repository,
|
||||
Encrypter $encrypter
|
||||
protected ConfigRepository $config,
|
||||
protected Encrypter $encrypter,
|
||||
protected DatabaseHostRepositoryInterface $repository
|
||||
) {
|
||||
$this->config = $config;
|
||||
$this->encrypter = $encrypter;
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a dynamic database connection entry to the runtime config.
|
||||
*
|
||||
* @param string $connection
|
||||
* @param \Pterodactyl\Models\DatabaseHost|int $host
|
||||
* @param string $database
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function set($connection, $host, $database = 'mysql')
|
||||
public function set(string $connection, DatabaseHost|int $host, string $database = 'mysql'): void
|
||||
{
|
||||
if (!$host instanceof DatabaseHost) {
|
||||
$host = $this->repository->find($host);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue