| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 14.29% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Driver extends AbstractOracleDriver |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * {@inheritdoc} |
||
| 16 | */ |
||
| 17 | public function connect(array $params, $username = null, $password = null, array $driverOptions = []) |
||
| 18 | { |
||
| 19 | try { |
||
| 20 | return new OCI8Connection( |
||
| 21 | (string) $username, |
||
| 22 | (string) $password, |
||
| 23 | $this->_constructDsn($params), |
||
| 24 | $params['charset'] ?? '', |
||
| 25 | $params['sessionMode'] ?? OCI_DEFAULT, |
||
| 26 | $params['persistent'] ?? false |
||
| 27 | ); |
||
| 28 | } catch (OCI8Exception $e) { |
||
| 29 | throw DBALException::driverException($this, $e); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Constructs the Oracle DSN. |
||
| 35 | * |
||
| 36 | * @param mixed[] $params |
||
| 37 | * |
||
| 38 | * @return string The DSN. |
||
| 39 | */ |
||
| 40 | protected function _constructDsn(array $params) |
||
| 41 | { |
||
| 42 | return $this->getEasyConnectString($params); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritdoc} |
||
| 47 | * |
||
| 48 | * @deprecated |
||
| 49 | */ |
||
| 50 | 25 | public function getName() |
|
| 53 | } |
||
| 54 | } |
||
| 55 |