Last modified: 2008-03-21 23:27:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12294 - Use of 'class Namespace' in Namespace.php conflicts with reserved word
Use of 'class Namespace' in Namespace.php conflicts with reserved word
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: High major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-12-13 20:07 UTC by Greg Sabino Mullane
Modified: 2008-03-21 23:27 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Greg Sabino Mullane 2007-12-13 20:07:41 UTC
Per user complaint on #mediawiki. It appears that "namespace" is a reserved word on some versions of PHP 5 (even though it should not yet be). In any case, it will officially be at some point, so the use of the class named "Namespace" needs to be changed, as this causes "unexpected T_NAMESPACE" errors when Namespace.php is loaded on those versions of PHP. Rather than attach a large patch to do this, which may get out of date, here's some code to make the needed change from "Namespace" to MWNamespace":

mv includes/Namespace.php includes/MWNamespace.php

find . \( -name "*.php" -o -name "*.inc" \) -exec grep -l Namespace {} \; | \
  xargs perl -pi -e 's/\bNamespace(\.php|::)/MWNamespace$1/'

Obviously, I'm not going to commit such a large change without discussion, hence this bug.
Comment 1 Ron Wezeman 2008-01-09 22:09:13 UTC
The needed change don't fix the bug when using php6.0.0.
Comment 2 Cristian Rodríguez 2008-01-30 23:49:53 UTC
This is now clearly reproducible when running PHP 5.3 s the namespace patch has been merged.
Comment 3 Brion Vibber 2008-03-21 23:27:46 UTC
r32309, r32310 replace Namespace with MWNamespace class in trunk (for 1.13).

A compat 'Namespace' class is retained for compatibility with unchanged extensions when running on PHP < 5.3.

Note You need to log in before you can comment on or make changes to this bug.