mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-23 07:06:18 +05:30
Merge pull request #1734 from PrivateBin/php85
Enable PHP 8.5 testing and handle deprecations
This commit is contained in:
commit
52c0846dad
3 changed files with 15 additions and 5 deletions
|
|
@ -84,8 +84,13 @@ class Database extends AbstractData
|
|||
);
|
||||
// MySQL uses backticks to quote identifiers by default,
|
||||
// tell it to expect ANSI SQL double quotes
|
||||
if ($this->_type === 'mysql' && defined('PDO::MYSQL_ATTR_INIT_COMMAND')) {
|
||||
$options['opt'][PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION sql_mode='ANSI_QUOTES'";
|
||||
if ($this->_type === 'mysql') {
|
||||
// deprecated as of PHP 8.5
|
||||
if (version_compare(PHP_VERSION, '8.5') < 0 && defined('PDO::MYSQL_ATTR_INIT_COMMAND')) {
|
||||
$options['opt'][PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION sql_mode='ANSI_QUOTES'";
|
||||
} elseif (defined('Pdo\Mysql::ATTR_INIT_COMMAND')) {
|
||||
$options['opt'][Pdo\Mysql::ATTR_INIT_COMMAND] = "SET SESSION sql_mode='ANSI_QUOTES'";
|
||||
}
|
||||
}
|
||||
$tableQuery = $this->_getTableQuery($this->_type);
|
||||
$this->_db = new PDO(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue