r103214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103213‎ | r103214 | r103215 >
Date:19:41, 15 November 2011
Author:aaron
Status:ok
Tags:
Comment:
Added Article::newFromWikiPage() function to create an appropriate Article object from a WikiPage and keep the process cache vars of the later
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -127,6 +127,19 @@
128128 }
129129
130130 /**
 131+ * Create an Article object of the appropriate class for the given page.
 132+ *
 133+ * @param $page WikiPage
 134+ * @param $context IContextSource
 135+ * @return Article object
 136+ */
 137+ public static function newFromWikiPage( WikiPage $page, IContextSource $context ) {
 138+ $article = self::newFromTitle( $page->getTitle(), $context );
 139+ $article->mPage = $page; // override to keep process cached vars
 140+ return $article;
 141+ }
 142+
 143+ /**
131144 * Tell the page view functions that this view was redirected
132145 * from another page on the wiki.
133146 * @param $from Title object.

Follow-up revisions

RevisionCommit summaryAuthorDate
r103215FU r93061, r102565:...aaron19:46, 15 November 2011

Status & tagging log