Last modified: 2011-03-13 18:05:55 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 T13688, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11688 - Renaming class User to MWUser
Renaming class User to MWUser
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-17 03:18 UTC by Nuno Tavares
Modified: 2011-03-13 18:05 UTC (History)
2 users (show)

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


Attachments
class User renamed to MWUser to avoid name collision (183.76 KB, patch)
2007-10-17 22:38 UTC, Nuno Tavares
Details

Description Nuno Tavares 2007-10-17 03:18:53 UTC
Greetings,

I'm sending this message to request some kind of feedback about an eventual renaming of the class User to another name, like MWUser, for instance. The reason is that it could allow/ease integration with other applications.

In fact, I'm having a class naming colision between mediawiki and another application, which has a very complex authentication backend, which is also not so flexible as mediawiki's. By renaming it, I could integrate both apps without having to provide a patch for each mediawiki that comes out.

I see no impact at renaming it, besides massive search&replace, so I'm asking you if there is any reason so that an eventual User->MWUser patch would not get into mainline.

I really look forward to hear from you,
-NT
Comment 1 Aaron Schulz 2007-10-17 05:07:32 UTC
Why not rename the other application's classes? There are many possible collisions that will probably not effect anyone, we could end up with a lot of renaming. If some third party application has issues, then that application needs tweaking, possible with a live patch on the sites that use it (if the makers of that app don't want to rename). Renaming would also break all kinds of MW extensions.
Comment 2 Brion Vibber 2007-10-17 12:51:06 UTC
Namespace support in PHP 5.3 & 6.0, in theory, could make such conflicts irrelevant in future.

Assuming it actually works sanely. :)
Comment 3 Nuno Tavares 2007-10-17 22:38:53 UTC
Created attachment 4265 [details]
class User renamed to MWUser to avoid name collision

Brion: exactly. It's one of the things I miss from Java and .NET

VoiceOfAll: I disagree with «If some third party application has issues, then that application
needs tweaking», specially in this case, where the application has thousands more lines that mediawiki, and bigger complexity. About the patch, that was what I was thinking: avoiding it would be the best solution and, come on, class User is pretty asking for a name colision :) If not with this particular app, it can happen with anyother which someone tries to integrate with. I didn't remember of extensions, and you are right. But, please, consider that they are usually small pieces of code (even mediawiki, I renamed the class in a few minutes) and either are still being actively developed, or are so old that they might not even run at 1.11 .

In any case, I'm posting this patch against 1.10.1 for anyone that needs it. It was human-made, so I preserved comments, except for references to "@return User object" (which turned to be "@return MWUser object"). I've tested it a bit, and it seems OK. If you later merge it, I can port it to 1.11, which shouldn't be difficult, I hope.

Enjoy, and thanks for the effort put up to mediawiki.
Comment 4 Aaron Schulz 2007-10-18 00:14:31 UTC
That still totally breaks extension and is thus totally unacceptable. I'd wait for namespace support and do it right.
Comment 5 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-10-18 00:21:41 UTC
Agree with VoA.  While this is an issue for integration with other apps, fixing it will cause more issues overall than it will solve, given that most MW users don't particularly need to integrate with other apps.  It might still be worthy of consideration for long-term benefit if namespaces weren't on the table, but PHP devs are apparently interested in adding those at some point, so it seems best to wait until then rather than doing a massive breaking change that will be superseded sooner or later anyway.  The short-term turmoil won't be outweighed by the long-term benefit, because there will *be* no long-term benefit.

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


Navigation
Links