Only add PDO::PGSQL_ATTR_DISABLE_PREPARES for versions of PHP that support it.

This commit is contained in:
FusionPBX 2022-08-18 17:37:43 -06:00 committed by GitHub
parent e4884fa4b1
commit 98b19d1f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -1130,7 +1130,12 @@ include "root.php";
}
//set the error mode
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION, PDO::PGSQL_ATTR_DISABLE_PREPARES);
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//reduce prepared statement latency
if (defined('PDO::PGSQL_ATTR_DISABLE_PREPARES') {
$this->db->setAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES);
}
//execute the query, and return the results
try {