<?php namespace Doctrine\DBAL\Driver\OCI8; use Doctrine\DBAL\Driver\AbstractOracleDriver; use Doctrine\DBAL\Driver\OCI8\Exception\ConnectionFailed; use SensitiveParameter; use function oci_connect; use function oci_pconnect; use const OCI_NO_AUTO_COMMIT; /** * A Doctrine DBAL driver for the Oracle OCI8 PHP extensions. */ final class Driver extends AbstractOracleDriver { /** * {@inheritdoc} * * @return Connection */ public function connect( #[SensitiveParameter] array $params ) { $username = $params['user'] ?? ''; $password = $params['password'] ?? ''; $charset = $params['charset'] ?? ''; $sessionMode = $params['sessionMode'] ?? OCI_NO_AUTO_COMMIT; $connectionString = $this->getEasyConnectString($params); if (! empty($params['persistent'])) { $connection = @oci_pconnect($username, $password, $connectionString, $charset, $sessionMode); } else { $connection = @oci_connect($username, $password, $connectionString, $charset, $sessionMode); } if ($connection === false) { throw ConnectionFailed::new(); } return new Connection($connection); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Exception | Folder | 0755 |
|
|
Middleware | Folder | 0755 |
|
|
Connection.php | File | 4.08 KB | 0644 |
|
ConvertPositionalToNamedPlaceholders.php | File | 1.28 KB | 0644 |
|
Driver.php | File | 1.22 KB | 0644 |
|
ExecutionMode.php | File | 636 B | 0644 |
|
Result.php | File | 2.91 KB | 0644 |
|
Statement.php | File | 4.93 KB | 0644 |
|