Skip to content

Commit

Permalink
Bump minimum PHP version to 8.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
  • Loading branch information
MauricioFauth committed Feb 10, 2023
1 parent 20d748e commit 040b4c5
Show file tree
Hide file tree
Showing 16 changed files with 305 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/daily-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
include:
- { version: '5.2', branch: 'QA_5_2', php-version: '7.2', node-version: '12', python-version: '3.7' }
- { version: '5.3', branch: 'master', php-version: '7.2', node-version: '14', python-version: '3.7' }
- { version: '6.0', branch: 'master', php-version: '8.1', node-version: '14', python-version: '3.7' }
steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-analyse-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.2"]
php-version: ["8.1"]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.2"]
php-version: ["8.1"]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/other-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.2"]
php-version: ["8.1"]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
fail-fast: false
matrix:
include:
- { php-version: '8', experimental: false, arch: 'amd64', exclude-phpunit-groups: 'extension-iconv' }
- { php-version: '8', experimental: false, arch: 'arm64v8', exclude-phpunit-groups: 'extension-iconv' }
- { php-version: '8', experimental: false, arch: 'arm32v7', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '8', experimental: false, arch: 'arm32v6', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '8', experimental: false, arch: 'i386', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '8', experimental: true, arch: 'ppc64le', exclude-phpunit-groups: 'extension-iconv' }
- { php-version: '8', experimental: false, arch: 's390x', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '81', experimental: false, arch: 'amd64', exclude-phpunit-groups: 'extension-iconv' }
- { php-version: '81', experimental: false, arch: 'arm64v8', exclude-phpunit-groups: 'extension-iconv' }
- { php-version: '81', experimental: false, arch: 'arm32v7', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '81', experimental: false, arch: 'arm32v6', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '81', experimental: false, arch: 'i386', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
- { php-version: '81', experimental: true, arch: 'ppc64le', exclude-phpunit-groups: 'extension-iconv' }
- { php-version: '81', experimental: false, arch: 's390x', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -56,18 +56,18 @@ jobs:
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

- name: Print arch
run: docker run --rm ${{ matrix.arch }}/alpine:3.15 uname -a
run: docker run --rm ${{ matrix.arch }}/alpine:3.17 uname -a

- name: Run tests on php ${{ matrix.php-version }}
run: docker run -v $PWD:/app --workdir /app --rm ${{ matrix.arch }}/alpine:3.15 sh /app/do-tests.sh
run: docker run -v $PWD:/app --workdir /app --rm ${{ matrix.arch }}/alpine:3.17 sh /app/do-tests.sh

test-php:
name: Test on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
php-version: ["8.1", "8.2"]
experimental: [false]
os: [ubuntu-latest]
phpunit-options: ['--testsuite unit']
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php-version: ["7.2"]
php-version: ["8.1"]
os: [ubuntu-latest]
extension: ["dbase", "recode"]
steps:
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.3']
php-version: ['8.1']
os: [ubuntu-latest]
php-extensions: ['mbstring, iconv, mysqli, zip, bz2']
psr-7-library: ['guzzlehttp/psr7', 'nyholm/psr7', 'laminas/laminas-diactoros']
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build:
nodes:
analysis:
environment:
php: 7.2
php: 8.1
node: 14
dependencies:
before:
Expand Down
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog
======================

6.0.0 (not yet released)
- issue Bump minimum PHP version to 8.1.0
- issue #17842 Change js.cookie.js to js.cookie.min.js
- issue #17632 Improve tab keypress to text fields on the login form

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"require": {
"php": "^7.2.5 || ^8.0",
"php": "^8.1",
"ext-hash": "*",
"ext-iconv": "*",
"ext-json": "*",
Expand Down Expand Up @@ -105,7 +105,7 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.4",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.5",
"phpunit/phpunit": "^9.5",
"pragmarx/google2fa-qrcode": "^2.1",
"psalm/plugin-phpunit": "^0.16.1",
"roave/security-advisories": "dev-latest",
Expand Down
1 change: 1 addition & 0 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ HHVM is supported up to phpMyAdmin 4.8.

Since release 5.0, phpMyAdmin supports only PHP 7.1 and newer.
Since release 5.2, phpMyAdmin supports only PHP 7.2 and newer.
Since release 6.0, phpMyAdmin supports only PHP 8.1 and newer.

.. _faq1_32:

Expand Down
2 changes: 1 addition & 1 deletion doc/require.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ web server (such as Apache, nginx, :term:`IIS`) to install phpMyAdmin's files in
PHP
---

* You need PHP 7.2.5 or newer, with ``session`` support, the Standard PHP Library
* You need PHP 8.1.0 or newer, with ``session`` support, the Standard PHP Library
(SPL) extension, hash, ctype, and JSON support.

* The ``mbstring`` extension (see :term:`mbstring`) is strongly recommended
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
define('PHPMYADMIN', true);
// phpcs:enable

if (PHP_VERSION_ID < 70205) {
die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
if (PHP_VERSION_ID < 80100) {
die('<p>PHP 8.1.0+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>');
}

require_once ROOT_PATH . 'libraries/constants.php';
Expand Down
18 changes: 1 addition & 17 deletions libraries/classes/Dbal/MysqliStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use mysqli_stmt;

use function count;
use function str_repeat;

use const PHP_VERSION_ID;

final class MysqliStatement implements Statement
{
Expand All @@ -33,20 +30,7 @@ public function execute(array $params): bool
return false;
}

if (PHP_VERSION_ID >= 80100) {
/**
* @psalm-suppress TooManyArguments
* @phpstan-ignore-next-line
*/
return $this->statement->execute($params);
}

$types = str_repeat('s', $paramCount);
if (! $this->statement->bind_param($types, ...$params)) {
return false;
}

return $this->statement->execute();
return $this->statement->execute($params);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions libraries/classes/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,13 @@ public static function localisedDate($timestamp = -1, $format = '')

$date = (string) preg_replace(
'@%[aA]@',
// phpcs:ignore Generic.PHP.DeprecatedFunctions
$dayOfWeek[(int) @strftime('%w', (int) $timestamp)],
$format
);
$date = (string) preg_replace(
'@%[bB]@',
// phpcs:ignore Generic.PHP.DeprecatedFunctions
$month[(int) @strftime('%m', (int) $timestamp) - 1],
$date
);
Expand All @@ -695,6 +697,7 @@ public static function localisedDate($timestamp = -1, $format = '')

// Can return false on windows for Japanese language
// See https://github.com/phpmyadmin/phpmyadmin/issues/15830
// phpcs:ignore Generic.PHP.DeprecatedFunctions
$ret = @strftime($date, (int) $timestamp);
// Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8
// output here. See https://github.com/phpmyadmin/phpmyadmin/issues/10598
Expand Down Expand Up @@ -1594,6 +1597,7 @@ public static function expandUserString(
}

/* Do the replacement */
// phpcs:ignore Generic.PHP.DeprecatedFunctions
return strtr((string) @strftime($string), $replace);
}

Expand Down
Loading

0 comments on commit 040b4c5

Please sign in to comment.