On 7/31/06, Rob Lanphier <robla(a)robla.net> wrote:
Suggestions:
* Change $wgNamespace to a static variable, accessed by new global
function: wfGetNamespace($nsnumber). This makes it much easier to
enforce the edict "Do NOT alter the $wgNamespaces object" (especially if
you threaten to return a clone from wfGetNamespace in future versions,
performance be damned)
* Create mNamespace member variable for the Title and Article objects
which is merely a reference to the corresponding namespace object (viva
PHP5).
* Add utility function for getting the default name given a constant.
Change this:
global $wgNamespace;
$wgNamespaces[NS_TALK]->getDefaultName()
...to one of the following, as appropriate:
wfGetDefaultNSName(NS_TALK)
...or (preferable when applicable):
$this->mNamespace->getDefaultName()
All this seems sensible and in line with the existing effort to reduce
reliance on globals. There's at least one other dev who is interested
in helping us with the final stretch in integrating the namespace
changes, so we should probably coordinate this by e-mail between the
three of us + Brion.
* (down the road) Create new objects which extend the
Article object,
and remove some/all of the namespace conditionals from the Article
object altogether (e.g. UserTalkPage object for User_talk:, SpecialPage
for "Special:", and SystemPage or MediaWikiPage for "MediaWiki:")
Or something like that. I think it definitely makes sense to
completely eliminate any hardcoded "magic" functionality of
namespaces. Indeed, it might even be nice for functionality like image
handling to be so compartmentalized that it can easily be ripped out
altogether.
Those are some thoughts for now. Looking forward to
seeing everyone at
Wikimania.
Likewise - I'm a few e-mails away from the airport. ;-)
Erik