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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14294, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12294 - Use of 'class Namespace' in Namespace.php conflicts with reserved word
Use of 'class Namespace' in Namespace.php conflicts with reserved word
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.12.x
All All
: High major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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.


Navigation
Links