backend cleanup

This commit is contained in:
robert dennis
2026-10-08 17:22:14 -04:00
parent cceaa535b8
commit bc50a8bbeb
46 changed files with 199 additions and 292 deletions
+4 -12
View File
@@ -4,9 +4,9 @@ declare(strict_types=1);
namespace Pterodactyl\Extensions;
use Illuminate\Config\Repository as ConfigRepository;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Crypt;
use Pterodactyl\Models\DatabaseHost;
class DynamicDatabaseConnection
@@ -17,14 +17,6 @@ class DynamicDatabaseConnection
public const string DB_DRIVER = 'mysql';
/**
* DynamicDatabaseConnection constructor.
*/
public function __construct(
protected ConfigRepository $config,
protected Encrypter $encrypter,
) {}
/**
* Adds a dynamic database connection entry to the runtime config.
*
@@ -36,13 +28,13 @@ class DynamicDatabaseConnection
$host = DatabaseHost::query()->findOrFail($host);
}
$this->config->set('database.connections.'.$connection, [
Config::set('database.connections.'.$connection, [
'driver' => self::DB_DRIVER,
'host' => $host->host,
'port' => $host->port,
'database' => $database,
'username' => $host->username,
'password' => $this->encrypter->decrypt($host->password),
'password' => Crypt::decrypt($host->password),
'charset' => self::DB_CHARSET,
'collation' => self::DB_COLLATION,
]);