* Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiC...
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 29 Jun 2011 22:09:51 +0000 (22:09 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 29 Jun 2011 22:09:51 +0000 (22:09 +0000)
commit930ccf282c7889f8c6fbba67d7c64d7bbe5262ca
tree47390dd9972b80dc4a97244c3bd557c015680025
parent1ddc07f845718df6411a32e7e27320b7ab23cf84
* Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiCategoryPage from CategoryPage.
* WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work).
* Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem).
* Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors.
* Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest().
* Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article.
* Removed ampersands from $dbw arguments.
* @TODO: dependency inject user objects for WikiPage

The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts).
15 files changed:
includes/Action.php
includes/Article.php
includes/AutoLoader.php
includes/CategoryPage.php
includes/ImagePage.php
includes/Metadata.php
includes/ProtectionForm.php
includes/RawPage.php
includes/Wiki.php
includes/WikiCategoryPage.php [new file with mode: 0644]
includes/WikiFilePage.php [new file with mode: 0644]
includes/WikiPage.php [new file with mode: 0644]
includes/actions/CreditsAction.php
includes/parser/ParserCache.php
tests/phpunit/includes/ArticleTest.php [new file with mode: 0644]