User "Catrope" posted a comment on MediaWiki.r91123.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/91123#c22026
Commit summary:

* 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).

Comment:

<pre>
+               $title = Title::makeTitle( NS_MAIN, 'somePage' );
</pre>
Why are you constructing a title that is invalid on most wikis (those that have 
$wgCapitalLinks enabled)?

<pre>
                } elseif ( !in_array( $fname, array( 'mContext', 'mPage' ) ) ) {
</pre>
What is this condition good for exactly? The code seems to allow people to 
create new properties except if they're called mContext or mPage, but 
<code>property_exists()</code> can't possibly return false for those, can it?

<pre>
                // Check if the field has been filled by ParserCache::get()
</pre>
This comment in WikiPage::getTimestamp() seems to be outdated since this 
revision moves the code filling <code>$mTimestamp</code> out of 
<code>ParserCache::get()</code> and into <code>Article::view()</code>

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to