r102847 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102846‎ | r102847 | r102848 >
Date:07:36, 12 November 2011
Author:ialex
Status:ok
Tags:
Comment:
Use WikiPage instead of Article
Modified paths:
  • /trunk/phase3/includes/api/ApiPageSet.php (modified) (history)
  • /trunk/phase3/includes/api/ApiProtect.php (modified) (history)
  • /trunk/phase3/includes/api/ApiRollback.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiProtect.php
@@ -107,13 +107,13 @@
108108 }
109109
110110 $cascade = $params['cascade'];
111 - $articleObj = new Article( $titleObj );
112111
113112 $watch = $params['watch'] ? 'watch' : $params['watchlist'];
114113 $this->setWatch( $watch, $titleObj );
115114
116115 if ( $titleObj->exists() ) {
117 - $ok = $articleObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray );
 116+ $pageObj = WikiPage::factory( $titleObj );
 117+ $ok = $pageObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray );
118118 } else {
119119 $ok = $titleObj->updateTitleProtection( $protections['create'], $params['reason'], $expiryarray['create'] );
120120 }
Index: trunk/phase3/includes/api/ApiRollback.php
@@ -53,10 +53,10 @@
5454
5555 // User and title already validated in call to getTokenSalt from Main
5656 $titleObj = $this->getRbTitle();
57 - $articleObj = new Article( $titleObj );
 57+ $pageObj = WikiPage::factory( $titleObj );
5858 $summary = ( isset( $params['summary'] ) ? $params['summary'] : '' );
5959 $details = array();
60 - $retval = $articleObj->doRollback( $this->getRbUser(), $summary, $params['token'], $params['markbot'], $details );
 60+ $retval = $pageObj->doRollback( $this->getRbUser(), $summary, $params['token'], $params['markbot'], $details, $this->getUser() );
6161
6262 if ( $retval ) {
6363 // We don't care about multiple errors, just report one of them
Index: trunk/phase3/includes/api/ApiPageSet.php
@@ -645,8 +645,8 @@
646646 // We found pages that aren't in the redirect table
647647 // Add them
648648 foreach ( $this->mPendingRedirectIDs as $id => $title ) {
649 - $article = new Article( $title );
650 - $rt = $article->insertRedirect();
 649+ $page = WikiPage::factory( $title );
 650+ $rt = $page->insertRedirect();
651651 if ( !$rt ) {
652652 // What the hell. Let's just ignore this
653653 continue;

Status & tagging log