Refactor the factory/i18n/list/etc static methods from SpecialPage into their own...
authorHappy-melon <happy-melon@users.mediawiki.org>
Sun, 17 Apr 2011 11:31:11 +0000 (11:31 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Sun, 17 Apr 2011 11:31:11 +0000 (11:31 +0000)
commit2c9cfd7cce6ba9de336cff9f9917385e5901b0c4
tree284a255537b78fa29bf38c17e10a92c7d4fc463a
parente77aa77cd80d402c765bede04f1ebc64993058e4
Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass.  Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.

Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
17 files changed:
includes/AutoLoader.php
includes/ChangesList.php
includes/Linker.php
includes/OutputPage.php
includes/PrefixSearch.php
includes/Skin.php
includes/SkinLegacy.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/SpecialPageFactory.php [new file with mode: 0644]
includes/Title.php
includes/Wiki.php
includes/api/ApiQuery.php
includes/parser/CoreParserFunctions.php
includes/parser/Parser.php
includes/specials/SpecialSpecialpages.php
maintenance/updateSpecialPages.php