Repository navigation
feat(php): add PHP 8.6 to site update - #540
Conversation
Allow `ee site update --php=8.6` and add the php86.zip config it switches the site to. The zip is the /usr/local/etc of the easyengine/php8.6 image (php.ini without the session.sid_length and session.sid_bits_per_character settings, the default php-fpm.conf and easyengine.conf) plus the custom.ini and msmtprc a site gets. The 8.6 base image has no PEAR, so the zip has no pear.conf.
The archive was built from the 8.6.0RC7 image. It's now rebuilt from the easyengine/php8.6 image on the php:8.6.0-fpm base, in the same way: the image's /usr/local/etc plus custom.ini and msmtprc. The files are byte-identical to the RC7 build. Only the archive entry dates change.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Feature Merge Risk:
|
The synopsis check compares --php loosely against the options, so values like 8.10, 8, 08.5, "8.5 " or 8.50 pass it as 8.1, 8.0 or 8.5 (and on PHP 7 also 8.5.0 or 8.5abc). update_php() then rewrites docker-compose.yml with an image that doesn't exist and relies on the rollback to put it back; a value like 8.5. even maps to php85.zip. Reject anything that isn't exactly an X.Y version before the update changes anything.
Summary
Adds PHP 8.6 to
ee site update --php, for EasyEngine v4.15.0.src/helper/class-ee-site.php:8.6in the--phphelp and options ofsite update.templates/config/php-fpm/php86.zip(new): the config a site gets when it switches to 8.6, built likephp85.zip(feat(config): add PHP 8.5 configuration zip file #471). It contains the/usr/local/etcof theeasyengine/php8.6image (feat(php): add the PHP 8.6 image dockerfiles#385, built onphp:8.6.0-fpm):php.iniwithoutsession.sid_length/session.sid_bits_per_character, the defaultphp-fpm.conf, andeasyengine.conf. It also has thecustom.inifromphp85.zipand amsmtprcthat points at the site's postfix.Compared with
php85.zip,php86.ziphas nopear.conf(the 8.6 base image has no PEAR). Itsconf.dfollows the 8.6 image:docker-php-ext-memcached.iniinstead ofmemcached.ini, a newdocker-php-ext-mbstring.ini, and noimap.ini/docker-php-ext-mcrypt.ini. Nothing in core or the site packages keys on those file names.The zip was first built from the 8.6.0RC7 image. The second commit rebuilds it from the 8.6.0 release image, and its files are byte-identical to the RC7 build.
The third commit fixes an older problem in
site update --php. Core's option check compares loosely, so values like8.10,8,08.5,"8.5 "or8.50pass as 8.1, 8.0 or 8.5 (on PHP 7 also8.5.0,8.5abcand8.5.).update_php()then wrote adocker-compose.ymlnaming an image that doesn't exist, such aseasyengine/php8.10:, tried to pull it, and relied on the rollback to put the site back (it does: the old compose file, config and DB value come back whether the pull or the missingphp810.zipfails). On PHP 7,8.5.even maps tophp85.zip.update()now rejects any--phpvalue that isn't exactly anX.Yversion withInvalid value specified for 'php': <value>, before it changes anything. Exact values such as--php=8.6and the errors for invalid ones (--php=latest,--php=9.9) behave as before.Context
easyengine/php8.6image comes from feat(php): add the PHP 8.6 image dockerfiles#385. It drops mcrypt and imap (they don't build on 8.6), builds memcached, redis and apcu from pinned upstream commits until their releases support 8.6, and keeps PHP 8.6's newsession.cookie_samesite = Laxdefault.img-versions.json(separate core PR). site-type-wp and site-type-php add--php=8.6tosite createin their own PRs, where 8.6 stays opt-in and the default moves to 8.5.drop_deprecated_session_sid_settingsmigration's PHP versions stay unchanged: the 8.6 configs never had those settings.Testing
PhpConfigTemplateTestandUpdatePhpTestin my local test suite, which is not part of this PR; run on PHP 7.4 and 8.5):site updateaccepts 8.6, every--phpoption has a config zip,php86.ziphasphp85.zip's layout, the 8.4, 8.5 and 8.6 zips have no sid settings, and the mail settings use msmtp and postfix.latest,7.1,8.7,9.0,5.5,abc) and the loosely matching ones, on each PHP version.update_php()with a recording site type: 8.5 → 8.6 and 8.6 → 8.5 (config tree = the target zip plus the site's owncustom.iniandeasyengine.conf, backup = the old tree),latestsites → 8.5 and → 8.4 (backup dirphp-latest), the "already at" check, and the rollbacks.update()rejects each of the 16 non-exact values before it writes or runs anything.develop, the 8.6 and guard tests fail (26) and the rest pass. The full local suite has no new failures.php86.zipextracted and mounted as/usr/local/etcofeasyengine/php8.6(whatee site update --php=8.6produces): php-fpm serves requests withsendmail_path = /usr/bin/msmtp -t, and/etc/msmtprcpoints at the site's postfix.php -lis clean on PHP 7.4 and 8.5.