Skip to content

Commit

Permalink
Merge pull request #5 from neighborhoods/bugfix/OPS-1109
Browse files Browse the repository at this point in the history
OPS-1109 | Set the ServerVersion using \PDO
  • Loading branch information
alexberryman committed Jun 13, 2018
2 parents 07deb95 + 693a87b commit 98a6798
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Doctrine/Connection/Decorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ public function getDoctrineConnection(): Connection
{
if (!$this->_exists(Connection::class)) {
if ($this->_hasPDO()) {
$connection = DriverManager::getConnection(['pdo' => $this->_getPDO()]);
$serverVersion = $this->_getPDO()->getAttribute(\PDO::ATTR_SERVER_VERSION);
$connection = DriverManager::getConnection(['pdo' => $this->_getPDO(), 'serverVersion' => $serverVersion]);
} else {
$pdoBuilder = $this->_getPDOBuilderFactory()->create();
$connection = DriverManager::getConnection(['pdo' => $pdoBuilder->getPdo()]);
$serverVersion = $pdoBuilder->getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION);
$connection = DriverManager::getConnection(['pdo' => $pdoBuilder->getPdo(), 'serverVersion' => $serverVersion]);
}

// $connection->getConfiguration()->setSQLLogger(new EchoSQLLogger());
Expand Down Expand Up @@ -69,4 +71,4 @@ public function getId(): string
{
return $this->_read(self::PROP_ID);
}
}
}

0 comments on commit 98a6798

Please sign in to comment.