Page MenuHomePhabricator

Make MediaWiki core compatible with PHP 7.4
Closed, ResolvedPublic

Description

Since PHP 7.4.0 has been released, we can start thinking about the compatibility.

The following is the problems from phpunit unit test:

Function ReflectionType::__toString() is deprecated

tests/phpunit/unit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php:225
tests/phpunit/MediaWikiUnitTestCase.php:110
maintenance/doMaintenance.php:99
  • Deprecated: Array and string offset access syntax with curly braces is deprecated in avro-php lib. (php-7.4.0RC1 note)
  • MWExceptionHandlerTest::testGetRedactedTrace: The stacktrace must have a function having an object has parameter; Failed asserting that false is true.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 16 2019, 2:20 PM
RazeSoldier updated the task description. (Show Details)Sep 16 2019, 2:28 PM

Change 537139 had a related patch set uploaded (by TK-999; owner: TK-999):
[avro-php@master] protocol: Fix compatibility with PHP 7.4

https://gerrit.wikimedia.org/r/537139

TK-999 added a subscriber: TK-999.Sep 16 2019, 3:19 PM

The issue in the RemexHTML lib seems to have been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/libs/RemexHtml/+/531022.

The issue in the RemexHTML lib seems to have been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/libs/RemexHtml/+/531022.

Yep, but MW is still using the old version. May need update dependence.

Change 537181 had a related patch set uploaded (by TK-999; owner: TK-999):
[mediawiki/core@master] services: Do not use deprecated ReflectionType::__toString() in tests

https://gerrit.wikimedia.org/r/537181

Change 537188 had a related patch set uploaded (by TK-999; owner: TK-999):
[mediawiki/core@master] SectionProfiler: Do not attempt to use null values as arrays

https://gerrit.wikimedia.org/r/537188

Change 537139 merged by jenkins-bot:
[avro-php@master] protocol: Fix compatibility with PHP 7.4

https://gerrit.wikimedia.org/r/537139

Change 537188 merged by jenkins-bot:
[mediawiki/core@master] SectionProfiler: Do not attempt to use null values as arrays

https://gerrit.wikimedia.org/r/537188

Reedy triaged this task as Low priority.Sep 16 2019, 11:42 PM
Reedy added a project: MediaWiki-General.

Change 537181 merged by jenkins-bot:
[mediawiki/core@master] services: Do not use deprecated ReflectionType::__toString() in tests

https://gerrit.wikimedia.org/r/537181

Change 537685 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Update remex-html library to 2.1.0

https://gerrit.wikimedia.org/r/537685

Change 537779 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/vendor@master] Update remex-html to 2.1.0

https://gerrit.wikimedia.org/r/537779

Change 537779 merged by jenkins-bot:
[mediawiki/vendor@master] Update remex-html to 2.1.0

https://gerrit.wikimedia.org/r/537779

Change 537685 merged by jenkins-bot:
[mediawiki/core@master] Update remex-html library to 2.1.0

https://gerrit.wikimedia.org/r/537685

RazeSoldier updated the task description. (Show Details)Sep 20 2019, 5:08 PM

I think we can announce support for PHP 7.4 in MediaWiki 1.35 release.

Reedy updated the task description. (Show Details)Sep 20 2019, 5:50 PM

Tagging MW-1.35-release, make this ticket as a MW 1.35 release blocker.

There are enough reasons to think that the next version (1.35) supports PHP 7.4 is a good choice.

MaxSem changed the status of subtask T192167: Upgrade PHPUnit from 4/6 to 8 from Stalled to Open.Oct 4 2019, 6:16 AM

Change 541657 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] Travis: test on PHP 7.4, allowing failures

https://gerrit.wikimedia.org/r/541657

Reedy updated the task description. (Show Details)Oct 8 2019, 11:52 PM

Change 541657 merged by jenkins-bot:
[mediawiki/core@master] Travis: test on PHP 7.4, allowing failures

https://gerrit.wikimedia.org/r/541657

Jdforrester-WMF changed the status of subtask T236132: Provide CI testing for PHP 7.4 from Open to Stalled.Oct 30 2019, 3:33 PM

Change 552394 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] PHP 7.4 fixes

https://gerrit.wikimedia.org/r/552394

Change 552394 merged by jenkins-bot:
[mediawiki/core@master] PHP 7.4 fixes

https://gerrit.wikimedia.org/r/552394

Jdforrester-WMF changed the status of subtask T236132: Provide CI testing for PHP 7.4 from Stalled to Open.Dec 2 2019, 5:05 PM

Weird. I skimmed through PHP 7.4 UPGRADING, and couldn't find anything interesting. I've also tested the faulty code on 3v4l (I still have to install PHP 7.4 locally), but the trace seems to have an object there.

Change 554202 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] WIP: fix PHP 7.4 error

https://gerrit.wikimedia.org/r/554202

MaxSem added a subscriber: MaxSem.Dec 3 2019, 1:59 AM

Weird. I skimmed through PHP 7.4 UPGRADING, and couldn't find anything interesting. I've also tested the faulty code on 3v4l (I still have to install PHP 7.4 locally), but the trace seems to have an object there.

Here:

zend.exception_ignore_args is a new INI directive for including or excluding arguments from stack traces generated from exceptions.

MaxSem added a comment.Dec 3 2019, 2:22 AM

And of course, it's not documented in https://www.php.net/manual/en/ini.list.php.

Change 554202 merged by jenkins-bot:
[mediawiki/core@master] Fix MWExceptionHandlerTest on PHP 7.4

https://gerrit.wikimedia.org/r/554202

Change 554326 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] layout: [mediawiki/core] Test with PHP74 for master

https://gerrit.wikimedia.org/r/554326

Here:

zend.exception_ignore_args is a new INI directive for including or excluding arguments from stack traces generated from exceptions.

Ah, nice catch. Sometimes it's surpsising to see how well the human brain can skip the exact section of a document that you're looking for.

Change 554368 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] layout: [skins] Add PHP74 tests as voting for master

https://gerrit.wikimedia.org/r/554368

Change 554368 merged by jenkins-bot:
[integration/config@master] layout: [skins] Add PHP74 tests as voting for master

https://gerrit.wikimedia.org/r/554368

Mentioned in SAL (#wikimedia-releng) [2019-12-03T21:24:16Z] <James_F> Enabling PHP74 tests as voting for MW skins T233012

SitRep:

Core itself works, but I'm not sure about all tarball extensions yet, so won't enable this there.

Skins were all working except Minerva, now fixed in T239727: MinervaNeue is not compatible with PHP7.4, so that's enabled.

Extensions found broken so far are T239726: ConfirmEdit is not compatible with PHP7.4, T239757: CirrusSearch is not compatible with PHP7.4, T239759: TimedMediaHandler is not compatible with PHP7.4, T239760: WikibaseLib is not compatible with PHP7.4, T239761: Wikibase is not compatible with PHP7.4.

Change 554669 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] UnregisteredLocalFile: fix PHP 7.4 warnings

https://gerrit.wikimedia.org/r/554669

Change 554669 merged by jenkins-bot:
[mediawiki/core@master] UnregisteredLocalFile: fix PHP 7.4 warnings

https://gerrit.wikimedia.org/r/554669

SitRep:

Core itself works, but I'm not sure about all tarball extensions yet, so won't enable this there.

Skins were all working except Minerva, now fixed in T239727: MinervaNeue is not compatible with PHP7.4, so that's enabled.

Extensions found broken so far are T239726: ConfirmEdit is not compatible with PHP7.4, T239757: CirrusSearch is not compatible with PHP7.4, T239759: TimedMediaHandler is not compatible with PHP7.4, T239760: WikibaseLib is not compatible with PHP7.4, T239761: Wikibase is not compatible with PHP7.4.

Skins are now un-enabled because of T242980. Fun.

Jdforrester-WMF raised the priority of this task from Low to High.Feb 26 2020, 6:24 PM

Change 579039 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] ResourceLoaderFileModule: Error if provided file is actually a directory

https://gerrit.wikimedia.org/r/579039

Change 554326 merged by jenkins-bot:
[integration/config@master] layout: [MediaWiki] Add PHP74 tests as voting for master

https://gerrit.wikimedia.org/r/554326

Mentioned in SAL (#wikimedia-releng) [2020-03-11T22:23:52Z] <James_F> Zuul: [MediaWiki] Add PHP74 tests as voting for master T233012

Change 579076 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] layout: [extensions] Add PHP74 tests as voting for master only

https://gerrit.wikimedia.org/r/579076

Change 579039 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Error in FileModule if provided path is a directory

https://gerrit.wikimedia.org/r/579039

Change 579076 merged by jenkins-bot:
[integration/config@master] layout: [extensions] Add PHP74 tests as voting for master only

https://gerrit.wikimedia.org/r/579076

Mentioned in SAL (#wikimedia-releng) [2020-03-12T16:59:40Z] <James_F> Zuul: Make PHP74 tests voting for extensions T233012

Mentioned in SAL (#wikimedia-releng) [2020-03-12T17:21:15Z] <James_F> Zuul: Make PHP74 tests voting for almost everything T233012

Change 579583 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TextExtracts@master] Fix PHP 7.4 compatibility

https://gerrit.wikimedia.org/r/579583

Change 579583 merged by jenkins-bot:
[mediawiki/extensions/TextExtracts@master] Fix PHP 7.4 compatibility

https://gerrit.wikimedia.org/r/579583

Jdforrester-WMF closed this task as Resolved.Mar 16 2020, 6:57 PM

Can we announce that MW 1.35 supports PHP 7.4?

I was waiting for extension support to be good enough, but we didn't reach the threshold where I was comfortable enforcing it, sadly. :-(

Examples of what needs to be fixed?

Don't remember off-hand; I think Scribunto and Wikibase had issues, but it was months ago. :-( Will re-check.