Add custom Doctrine Driver
[MAILPOET-3150]
This commit is contained in:
22
lib/Doctrine/Driver/Driver.php
Normal file
22
lib/Doctrine/Driver/Driver.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Doctrine\Driver;
|
||||
|
||||
use MailPoetVendor\Doctrine\DBAL\DBALException;
|
||||
|
||||
class Driver extends \MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver {
|
||||
public function connect(array $params, $username = null, $password = null, array $driverOptions = []) {
|
||||
try {
|
||||
$conn = new PDOConnection(
|
||||
$this->constructPdoDsn($params),
|
||||
$username,
|
||||
$password,
|
||||
$driverOptions
|
||||
);
|
||||
} catch (\PDOException $e) {
|
||||
throw DBALException::driverException($this, $e);
|
||||
}
|
||||
|
||||
return $conn;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user