Page MenuHomePhabricator

BagOStuff.php still uses a PHP4-style constructur, which does not work on PHP 5.0.4
Closed, ResolvedPublic

Description

Author: mail

Description:
I tried using MediaWiki 1.10.0 on a PHP 5.0.4 32-Bit system (cannot upgrade to a newer PHP version for some reasons).

Unfortunately, I almost always got "Database Error" pages.
The SQL query showed that the table name was empty. MediaWiki executed SQL queries like "SELECT value,exptime FROM '' WHERE ...".
Strangely, in some rare cases, the Wiki worked correctly for some people, but only in very rare cases.
Here is a screenshot of the problem: http://img513.imageshack.us/img513/3658/wikiupdate3qx1.jpg (original MediaWiki shows it without the self-added debug information at the top of the page).

I looked into the code and saw that the "includes/BagOStuff.php" uses a PHP4-style constructor on line 225. When I changed this to "__construct", the Wiki works correctly for me.
This is most-probably a PHP 5.0.4 problem, but as MediaWiki 1.10.0 should work with all PHP 5.x versions, this problem should be fixed in MediaWiki.

If you need any additional information, just ask.


Version: 1.10.x
Severity: enhancement

Details

Reference
bz10140

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:49 PM
bzimport set Reference to bz10140.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

Please check this isn't due to a broken or outdated version of eAccelerator or Zend Optimizer, first.

mail wrote:

Sorry, I'm not the administrator of this server, so I cannot test, what happens if I leave out a specific module.

The only thing I can add is that this change will be in the MediaWiki code anyway at some time if you plan to convert everything to PHP 5.x style.
I already saw these "__construct" functions in other files like Database.php, so it's not other coding style or something like that.

Therefore I think, you should change that function as it also fixes this bug in my case.

ayg wrote:

No reason not to do this. Changed in r22723.