Repository navigation
Require PHP 8.2 or newer - #651
Conversation
|
I tested both on local OCPL and OCDE, seems to work fine on both. @andrixnet @harrieklomp Could you confirm that no OCPL node is running older PHP version? Also, do you plan upgrading OCRO, OCNL and OCUS? Do you know what version is OCUK using? |
|
OCRO, OCNL, OCUS currently run 7.4. Upgrade is planned, however I cannot promise a precise timeframe. |
|
Thanks! In the meantime I also found opencaching/opencaching-pl#2364, so I believe that OCUK should be good too. |
hxdimpf
left a comment
There was a problem hiding this comment.
Looks good to me.
- The autoloader is exactly what Composer generates. I ran
composer dump-autoload(Composer 2.10.3) inokapi/on this branch, and the result is byte-identical to the committedokapi/vendor/. - The new platform check works: on PHP 7.3 loading
vendor/autoload.phpstops inplatform_check.phpwith the version message; on PHP 7.4 and 8.4 it loads andokapi\core\Okapiis found. Db.php: dropping theSET NAMESfallback is fine; thecharsetDSN option is there since PHP 5.3.6.- On the VM (this branch on the current master), OCDE and OCPL on MariaDB 10.11 and 10.0, with the suite from #653, read-only and
--write: 0 failures.
With @andrixnet's answer (OCRO, OCNL, OCUS on 7.4) and OCUK covered, 7.4 is the right floor. It also makes #652 safe, which needs PHP 7.0 for random_int() / random_bytes().
|
An update on the PHP versions: @andrixnet told me by mail that OCRO, OCNL and OCUS have now moved to PHP 8.2, and that from his side OKAPI can require 8.2. Andrei, please correct me if I got that wrong. So the open question is the remaining installations. @stefopl @jrmajor (opencaching.pl) and @harrieklomp (OCUK): do they run PHP 8.2 or newer? A yes or no is enough; nobody needs to post exact versions. If all of them do, I'd suggest raising the floor in this PR from 7.4 to 8.2 instead of doing it in two steps. With PHP 8 as the minimum, the E_STRICT check in |
|
OCPL, OCUK 8.3 |
|
OCRO, OCNL, OCUS: PHP-8.2 IMO you can raise the floor to 8.2 |
|
Thanks @stefopl and @andrixnet. So every installation now runs PHP 8.2 or newer (OCPL and OCUK 8.3; OCRO, OCNL and OCUS 8.2). @jrmajor, would you raise this PR to |
|
@jrmajor, a gentle ping: since every installation runs PHP 8.2 or newer, would you raise this PR to |
|
Updated requirement to PHP 8.2. |
hxdimpf
left a comment
There was a problem hiding this comment.
Re-approving the 8.2 version (head bb1ea37). Tested on our VM (PHP 8.2.31): OCDE, OCPL on MariaDB 10.11 and OCPL on MariaDB 10.0, test suite read-only and with --write, 0 failures. The regenerated okapi/vendor/ is byte-identical to composer dump-autoload with Composer 2, and the removed workarounds are dead code on 8.2. Thanks for taking the E_STRICT check out too.
Nit: the description still says the platform check stops PHP "older than 7.4"; it's 8.2 now.
Sync with opencaching/okapi: PHP 8.2 minimum (opencaching#651)
Entries in `etc/changes.xml` for the changes merged since the last changelog PR (#665) that matter to client developers or site admins: #649, #654, #646, #651, #682, #680, #666, #676, #672, #671, #667. Version numbers and times were filled in by `etc/update_changes.php`. #652 has no visible change for clients, so it has no entry.
Based on information from #650 (comment), bumps the minimum PHP version from 5.6 to 7.4 incomposer.json,okapi/composer.jsonand the README.Update: bumped it to 8.2.
The committed
okapi/vendor/was regenerated withcomposer dump-autoload(Composer 2). The old autoloader dated from 2017 and was made by Composer 1. The new one addsplatform_check.php, so OKAPI stops with a clear error on PHP versions older than 7.4 instead of failing somewhere later.Also removed the
SET NAMESfallback fromDb.php. It was only used on PHP older than 5.3.6, which didn't support thecharsetDSN option. The connection charset is still set through the DSN.