Skip to content

Commit

Permalink
OPS-1109 | define a serverVersion so that Doctrine can pick the corre…
Browse files Browse the repository at this point in the history
…ct platform
  • Loading branch information
alexberryman committed Jun 12, 2018
1 parent 47f819f commit 693a87b
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 693a87b

Please sign in to comment.