Page MenuHomePhabricator

Start using PHP 7.0 features in WMDE maintained extensions
Closed, ResolvedPublic

Description

MediaWiki 1.31 from April 2018 started to require PHP 7.0+ (see T172165). Since all our actively developed codebases depend on what was on core's master branch at the time, all these codebases do depend on MediaWiki 1.31, and therefore do in fact already depend on PHP 7.0+. At this point it might bee pointless to keep the compatibility with PHP 5.6.

What to do

extension.json
"requires": {
	"MediaWiki": ">= 1.31.0"
}

(It seems updating composer.json to contain "require": { "php": ">=5.6.99" } is not necessary.)

Possibly update the MediaWiki-Codesniffer as well. Then start using all the new features PHP 7.0 introduced.

Why

  • Most extensions still specify compatibility with MediaWiki 1.31 because it is the current LTS version.
  • Extensions are allowed to go higher when needed, e.g. when we need to use a core feature from a later version. We can still backport most changes (all that don't use new features). Having to support an LTS version does not mean you can't use new features.
  • However, we believe it is a good idea to freeze the required PHP version to 7.0, and not use 7.1+ features. This makes possible backports easier.

Relevant German-Community-Wishlist extensions:

Event Timeline

WMDE-Fisch updated the task description. (Show Details)Jan 10 2019, 11:26 AM
thiemowmde triaged this task as Normal priority.Jan 16 2019, 3:20 PM

From the list above it seems that only Electron-PDFs and #File-exporter requires old version

ElectronPdfService requires 1.25, but using MediaWiki::getInstance() from 1.27
FileExporter does not specifiy a requires, but also using MediaWikiServices::getInstance()

The other listed extension requires 1.32

It is okay to bump both extensions to 1.27 in context of this task?

From the list above it seems that only Electron-PDFs and #File-exporter requires old version
ElectronPdfService requires 1.25, but using MediaWiki::getInstance() from 1.27
FileExporter does not specifiy a requires, but also using MediaWikiServices::getInstance()
The other listed extension requires 1.32
It is okay to bump both extensions to 1.27 in context of this task?

Hey thanks for the ping. Yes, please do so.

Change 505820 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/ElectronPdfService@master] Require MediaWiki >= 1.27.0

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

Change 505821 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/FileExporter@master] Require MediaWiki >= 1.27.0

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

Change 505820 merged by jenkins-bot:
[mediawiki/extensions/ElectronPdfService@master] Require MediaWiki >= 1.27.0

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

Change 505821 merged by jenkins-bot:
[mediawiki/extensions/FileExporter@master] Require MediaWiki >= 1.27.0

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

From the list above it seems that only Electron-PDFs and #File-exporter requires old version
ElectronPdfService requires 1.25, but using MediaWiki::getInstance() from 1.27
FileExporter does not specifiy a requires, but also using MediaWikiServices::getInstance()
The other listed extension requires 1.32
It is okay to bump both extensions to 1.27 in context of this task?

Hey thanks for the ping. Yes, please do so.

Done, suggest "resolved", but not sure if that is okay from your point.

The bump to 1.27 was fine, thanks a lot for that! But to mark this task here as resolved we would need to bump to 1.31 (assuming my analysis in the task description was correct), and actually start using PHP 7.0 features in the listed codebases.

But when the extension does not need features from 1.31 or php7 than it is possible to bump it for the future use of that features, but it does not bring any additional values to the extension.

The task can stay open until the features are needed or the goal is changed of the task.

But it seems the ElectronPdfService is using ?? as feature from php7 or hhvm, so it could work with 1.27 under php7.

thiemowmde updated the task description. (Show Details)May 21 2019, 1:05 PM

Change 511694 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/ElectronPdfService@master] Update required MediaWiki version to 1.31

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

thiemowmde closed this task as Resolved.May 21 2019, 4:10 PM
thiemowmde claimed this task.

Change 511694 merged by jenkins-bot:
[mediawiki/extensions/ElectronPdfService@master] Update required MediaWiki version to 1.31

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