Page MenuHomePhabricator

__DIR__ incompatible with PHP 5.2.17
Closed, InvalidPublic

Description

Author: maxneaga

Description:
+++ This bug was initially created as a clone of Bug #62486 +++

The Compatibility ( http://www.mediawiki.org/wiki/Compatibility ) page states that MediaWiki 1.19.x branch is compatible with PHP 5.2.3+

The core extension ConfirmEdit uses the DIR magic constant that is available in PHP 5.3.0+ only.

Had to use the following command as a temporary fix:

find . -type f -exec sed -i 's/__DIR__/dirname(__FILE__)/g' {} \;

Version: REL1_19-branch
Severity: critical

Details

Reference
bz62502

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:58 AM
bzimport set Reference to bz62502.
bzimport added a subscriber: Unknown Object (MLST).

Are you definitely using the REL1_19 branch of ConfirmEdit? https://github.com/wikimedia/mediawiki-extensions-ConfirmEdit/tree/REL1_19

Using this commit https://github.com/wikimedia/mediawiki-extensions-ConfirmEdit/commit/6b867ba9292837133ff674351f12e946b2444fd1

reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/extensions/ConfirmEdit$ git checkout 6b867ba9292837133ff674351f12e946b2444fd1
HEAD is now at 6b867ba... Localisation updates for core and extension messages from translatewiki.net
reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/extensions/ConfirmEdit$ grep DIR *
reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/extensions/ConfirmEdit$

I went to https://www.mediawiki.org/wiki/Download and downloaded the 1.19.12 tarball:

$:andre\> pwd
/home/andre/mediawiki-1.19.12/extensions/ConfirmEdit
$:andre\> grep DIR *
Asirra.php:$dir = DIR;
ConfirmEdit.php:$wgConfirmEditIP = DIR;
FancyCaptcha.php:$dir = DIR;
grep: maintenance: Is a directory
MathCaptcha.php:$dir = DIR;
QuestyCaptcha.php:$dir = DIR;
ReCaptcha.php:$dir = DIR;
grep: resources: Is a directory

Sigh. So this is a bug in the tarball but not in the code repository of the extension... Workaround is to manually get the extension code from Git, I guess.

Closing as INVALID here for the code repository; tracking the problem with the tarballs in bug 62101.

Maxim: Thanks for catching this. :-/