Skip to content

Commit aec12f5

Browse files
Merge pull request #57116 from nextcloud/php/8.5
ci(PHP): Test against 8.5 on CI
2 parents e91840a + 226b7df commit aec12f5

File tree

17 files changed

+72
-62
lines changed

17 files changed

+72
-62
lines changed

.github/workflows/lint-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
strategy:
4949
matrix:
50-
php-versions: [ '8.2', '8.3', '8.4' ]
50+
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
5151

5252
name: php-lint
5353

.github/workflows/phpunit-mariadb.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ jobs:
6060
fail-fast: false
6161
matrix:
6262
php-versions: ['8.2']
63-
mariadb-versions: ['10.3', '10.6', '10.11', '11.4', '11.8']
63+
mariadb-versions: ['10.6', '10.11', '11.4', '11.8']
6464
include:
6565
- php-versions: '8.3'
6666
mariadb-versions: '10.11'
6767
coverage: ${{ github.event_name != 'pull_request' }}
6868
- php-versions: '8.4'
6969
mariadb-versions: '11.8'
70+
- php-versions: '8.5'
71+
mariadb-versions: '11.8'
7072

7173
name: MariaDB ${{ matrix.mariadb-versions }} (PHP ${{ matrix.php-versions }}) - database tests
7274

.github/workflows/phpunit-memcached.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
strategy:
5757
fail-fast: false
5858
matrix:
59-
php-versions: ['8.3', '8.4']
59+
php-versions: ['8.3', '8.4', '8.5']
6060
include:
6161
- php-versions: '8.2'
6262
coverage: ${{ github.event_name != 'pull_request' }}

.github/workflows/phpunit-mysql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767
coverage: ${{ github.event_name != 'pull_request' }}
6868
- mysql-versions: '8.4'
6969
php-versions: '8.4'
70+
- mysql-versions: '8.4'
71+
php-versions: '8.5'
7072

7173
name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests
7274

.github/workflows/phpunit-nodb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
php-versions: ['8.3', '8.4']
62+
php-versions: ['8.3', '8.4', '8.5']
6363
include:
6464
- php-versions: '8.2'
6565
coverage: ${{ github.event_name != 'pull_request' }}

.github/workflows/phpunit-oci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
php-versions: '8.3'
7070
- oracle-versions: '23'
7171
php-versions: '8.4'
72+
- oracle-versions: '23'
73+
php-versions: '8.5'
7274

7375
name: Oracle ${{ matrix.oracle-versions }} (PHP ${{ matrix.php-versions }}) - database tests
7476

.github/workflows/phpunit-pgsql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
coverage: ${{ github.event_name != 'pull_request' }}
6969
- php-versions: '8.4'
7070
postgres-versions: '18'
71+
- php-versions: '8.5'
72+
postgres-versions: '18'
7173

7274
name: PostgreSQL ${{ matrix.postgres-versions }} (PHP ${{ matrix.php-versions }}) - database tests
7375

.github/workflows/phpunit-sqlite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
php-versions: ['8.3', '8.4']
62+
php-versions: ['8.3', '8.4', '8.5']
6363
include:
6464
- php-versions: '8.2'
6565
coverage: ${{ github.event_name != 'pull_request' }}

apps/files_sharing/tests/SharedMountTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ public function testShareMountOverShare(): void {
375375
$mountProvider = Server::get(MountProvider::class);
376376
$reflectionClass = new \ReflectionClass($mountProvider);
377377
$reflectionCacheFactory = $reflectionClass->getProperty('cacheFactory');
378-
$reflectionCacheFactory->setAccessible(true);
379378
$reflectionCacheFactory->setValue($mountProvider, $cacheFactory);
380379

381380
// share to user

lib/private/DB/ConnectionFactory.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,23 @@ public function getDefaultConnectionParams($type) {
8888
throw new \InvalidArgumentException("Unsupported type: $type");
8989
}
9090
$result = $this->defaultConnectionParams[$normalizedType];
91-
// \PDO::MYSQL_ATTR_FOUND_ROWS may not be defined, e.g. when the MySQL
92-
// driver is missing. In this case, we won't be able to connect anyway.
93-
if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) {
94-
$result['driverOptions'] = [
95-
\PDO::MYSQL_ATTR_FOUND_ROWS => true,
96-
];
91+
/**
92+
* {@see \PDO::MYSQL_ATTR_FOUND_ROWS} may not be defined, e.g. when the MySQL
93+
* driver is missing. In this case, we won't be able to connect anyway.
94+
* In PHP 8.5 it's deprecated and {@see \Pdo\Mysql::ATTR_FOUND_ROWS} should be used,
95+
* but that is only available since PHP 8.4
96+
*/
97+
if ($normalizedType === 'mysql') {
98+
if (PHP_VERSION_ID >= 80500 && class_exists(\Pdo\Mysql::class)) {
99+
/** @psalm-suppress UndefinedClass */
100+
$result['driverOptions'] = [
101+
\Pdo\Mysql::ATTR_FOUND_ROWS => true,
102+
];
103+
} elseif (PHP_VERSION_ID < 80500 && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) {
104+
$result['driverOptions'] = [
105+
\PDO::MYSQL_ATTR_FOUND_ROWS => true,
106+
];
107+
}
97108
}
98109
return $result;
99110
}

0 commit comments

Comments
 (0)