Skip to content

Commit

Permalink
fix usage of PDO::PGSQL_ATTR_DISABLE_PREPARES for pdo_pgsql extension…
Browse files Browse the repository at this point in the history
… setups not built from PHP core

fixes #2249
  • Loading branch information
deeky666 authored and Ocramius committed Jan 5, 2016
1 parent 2a7faab commit 527d8cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function connect(array $params, $username = null, $password = null, array
$driverOptions
);

if (PHP_VERSION_ID >= 50600
if (defined('PDO::PGSQL_ATTR_DISABLE_PREPARES')
&& (! isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES])
|| true === $driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES]
)
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function createDriver()
*/
private function skipWhenNotUsingPhp56AndPdoPgsql()
{
if (PHP_VERSION_ID < 50600) {
if (! defined('PDO::PGSQL_ATTR_DISABLE_PREPARES')) {
$this->markTestSkipped('Test requires PHP 5.6+');
}

Expand Down

0 comments on commit 527d8cd

Please sign in to comment.