updated-packages
This commit is contained in:
@@ -2,13 +2,16 @@
|
||||
|
||||
namespace Doctrine\DBAL\Driver\PDOMySql;
|
||||
|
||||
use Doctrine\DBAL\DBALException;
|
||||
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
|
||||
use Doctrine\DBAL\Driver\PDOConnection;
|
||||
use Doctrine\DBAL\Driver\PDO;
|
||||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use PDOException;
|
||||
|
||||
/**
|
||||
* PDO MySql driver.
|
||||
*
|
||||
* @deprecated Use {@link PDO\MySQL\Driver} instead.
|
||||
*/
|
||||
class Driver extends AbstractMySQLDriver
|
||||
{
|
||||
@@ -18,14 +21,14 @@ class Driver extends AbstractMySQLDriver
|
||||
public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
|
||||
{
|
||||
try {
|
||||
$conn = new PDOConnection(
|
||||
$conn = new PDO\Connection(
|
||||
$this->constructPdoDsn($params),
|
||||
$username,
|
||||
$password,
|
||||
$driverOptions
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
throw DBALException::driverException($this, $e);
|
||||
throw Exception::driverException($this, $e);
|
||||
}
|
||||
|
||||
return $conn;
|
||||
@@ -44,15 +47,19 @@ class Driver extends AbstractMySQLDriver
|
||||
if (isset($params['host']) && $params['host'] !== '') {
|
||||
$dsn .= 'host=' . $params['host'] . ';';
|
||||
}
|
||||
|
||||
if (isset($params['port'])) {
|
||||
$dsn .= 'port=' . $params['port'] . ';';
|
||||
}
|
||||
|
||||
if (isset($params['dbname'])) {
|
||||
$dsn .= 'dbname=' . $params['dbname'] . ';';
|
||||
}
|
||||
|
||||
if (isset($params['unix_socket'])) {
|
||||
$dsn .= 'unix_socket=' . $params['unix_socket'] . ';';
|
||||
}
|
||||
|
||||
if (isset($params['charset'])) {
|
||||
$dsn .= 'charset=' . $params['charset'] . ';';
|
||||
}
|
||||
@@ -62,9 +69,17 @@ class Driver extends AbstractMySQLDriver
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/issues/3580',
|
||||
'Driver::getName() is deprecated'
|
||||
);
|
||||
|
||||
return 'pdo_mysql';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user