mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-14 19:45:21 +02:00
[ticket/16840] Add PHP 8.0 / 8.1 builds for Windows tests
Also fix Postrges PHP 8.1 related issue. PHPBB3-16840
This commit is contained in:
parent
c64b6f0f9e
commit
cbbe819aff
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@ -448,6 +448,10 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- php: '7.4'
|
- php: '7.4'
|
||||||
db: "postgres"
|
db: "postgres"
|
||||||
|
- php: '8.0'
|
||||||
|
db: "postgres"
|
||||||
|
- php: '8.1'
|
||||||
|
db: "postgres"
|
||||||
|
|
||||||
name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }}
|
name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }}
|
||||||
|
|
||||||
@ -523,6 +527,8 @@ jobs:
|
|||||||
Set-ACL -Path "${env:TEMP_DIR}" -ACLObject $acl
|
Set-ACL -Path "${env:TEMP_DIR}" -ACLObject $acl
|
||||||
cd ${env:GITHUB_WORKSPACE}\phpBB
|
cd ${env:GITHUB_WORKSPACE}\phpBB
|
||||||
php ..\composer.phar install
|
php ..\composer.phar install
|
||||||
|
php ..\composer.phar remove phpunit/dbunit --dev --update-with-dependencies
|
||||||
|
php ..\composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 phpunit/phpunit:^9.3 --dev --update-with-all-dependencies --ignore-platform-reqs
|
||||||
cd ..
|
cd ..
|
||||||
- name: Setup database
|
- name: Setup database
|
||||||
run: |
|
run: |
|
||||||
|
@ -207,14 +207,16 @@ class postgres extends \phpbb\db\driver\driver
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$safe_query_id = $this->clean_query_id($this->query_result);
|
||||||
|
|
||||||
if ($cache && $cache_ttl)
|
if ($cache && $cache_ttl)
|
||||||
{
|
{
|
||||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
$this->open_queries[$safe_query_id] = $this->query_result;
|
||||||
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
|
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
|
||||||
}
|
}
|
||||||
else if (strpos($query, 'SELECT') === 0)
|
else if (strpos($query, 'SELECT') === 0)
|
||||||
{
|
{
|
||||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
$this->open_queries[$safe_query_id] = $this->query_result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($this->debug_sql_explain)
|
else if ($this->debug_sql_explain)
|
||||||
@ -555,6 +557,15 @@ class postgres extends \phpbb\db\driver\driver
|
|||||||
*/
|
*/
|
||||||
private function clean_query_id($query_id)
|
private function clean_query_id($query_id)
|
||||||
{
|
{
|
||||||
return is_resource($query_id) ? (int) $query_id : $query_id;
|
// As of PHP 8.1 PgSQL functions accept/return \PgSQL\* objects instead of "pgsql *" resources
|
||||||
|
// Attempting to cast object to int will throw error, hence correctly handle all cases
|
||||||
|
if (is_resource($query_id))
|
||||||
|
{
|
||||||
|
return function_exists('get_resource_id') ? get_resource_id($query_id) : (int) $query_id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return is_object($query_id) ? spl_object_id($query_id) : $query_id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user