From c6343be01b657b4f3fe56d430bfeb1f234143147 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 2 Dec 2025 06:44:53 +0100 Subject: [PATCH 1/3] enable PHP 8.5 for testing --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 30915156..64767946 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,11 +27,11 @@ jobs: continue-on-error: "${{ matrix.experimental }}" strategy: matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] experimental: [false] # uncomment this to start testing on development release # include: -# - php-versions: '8.5' # development release, things can break +# - php-versions: '8.6' # development release, things can break # experimental: true env: extensions: gd, sqlite3 From 6f778eeec3692615466d3ac38d6c6eefb1b0323c Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 2 Dec 2025 06:54:36 +0100 Subject: [PATCH 2/3] address PHP 8.5 deprecation --- tst/ControllerTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tst/ControllerTest.php b/tst/ControllerTest.php index 41aad6e9..db6b6ccb 100644 --- a/tst/ControllerTest.php +++ b/tst/ControllerTest.php @@ -155,7 +155,12 @@ class ControllerTest extends TestCase { $newConfig = new class extends Configuration {}; $configValue = (new ReflectionClass(Controller::class))->getProperty('_conf'); - $configValue->setAccessible(true); + if (version_compare(PHP_VERSION, '8.1') < 0) { + // > This function has been DEPRECATED as of PHP 8.5.0. [...] + // > As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. + // @see: https://www.php.net/manual/en/reflectionproperty.setaccessible.php + $configValue->setAccessible(true); + } ob_start(); $controller = new Controller($newConfig); ob_end_clean(); From eaf8f9f92ea8de9a5dc0deeb6d8fa46aa72d6c89 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 2 Dec 2025 07:07:04 +0100 Subject: [PATCH 3/3] address PHP 8.5 deprecation --- lib/Data/Database.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Data/Database.php b/lib/Data/Database.php index a574c13a..61c6ec77 100644 --- a/lib/Data/Database.php +++ b/lib/Data/Database.php @@ -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(