r64196 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64195‎ | r64196 | r64197 >
Date:22:12, 25 March 2010
Author:reedy
Status:ok
Tags:
Comment:
Revert my api changes to pre r64815
Modified paths:
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMove.php (modified) (history)
  • /trunk/phase3/includes/api/ApiProtect.php (modified) (history)
  • /trunk/phase3/includes/api/ApiRollback.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUndelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMove.php
@@ -39,11 +39,6 @@
4040 public function execute() {
4141 global $wgUser;
4242 $params = $this->extractRequestParams();
43 -
44 - if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
45 - $this->dieUsageMsg( array( 'show' ) );
46 - }
47 -
4843 if ( is_null( $params['reason'] ) ) {
4944 $params['reason'] = '';
5045 }
@@ -216,7 +211,6 @@
217212 array( 'notanarticle' ),
218213 array( 'invalidtitle', 'to' ),
219214 array( 'sharedfile-exists' ),
220 - array( 'show' ),
221215 ) );
222216 }
223217
Index: trunk/phase3/includes/api/ApiProtect.php
@@ -39,10 +39,6 @@
4040 public function execute() {
4141 global $wgUser, $wgRestrictionTypes, $wgRestrictionLevels;
4242 $params = $this->extractRequestParams();
43 -
44 - if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
45 - $this->dieUsageMsg( array( 'show' ) );
46 - }
4743
4844 $titleObj = null;
4945 if ( !isset( $params['title'] ) ) {
@@ -119,10 +115,7 @@
120116 $articleObj = new Article( $titleObj );
121117 if ( $params['watch'] ) {
122118 $articleObj->doWatch();
123 - } elseif ( $params['unwatch'] ) {
124 - $articleObj->doUnwatch();
125119 }
126 -
127120 if ( $titleObj->exists() ) {
128121 $ok = $articleObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray );
129122 } else {
@@ -168,7 +161,6 @@
169162 'reason' => '',
170163 'cascade' => false,
171164 'watch' => false,
172 - 'unwatch' => false,
173165 );
174166 }
175167
@@ -183,7 +175,6 @@
184176 'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)',
185177 'Ignored if not all protection levels are \'sysop\' or \'protect\'' ),
186178 'watch' => 'If set, add the page being (un)protected to your watchlist',
187 - 'unwatch' => 'Remove the page being (un)protected from your watchlist',
188179 );
189180 }
190181
@@ -205,7 +196,6 @@
206197 array( 'protect-invalidlevel', 'level' ),
207198 array( 'invalidexpiry', 'expiry' ),
208199 array( 'pastexpiry', 'expiry' ),
209 - array( 'show' ),
210200 ) );
211201 }
212202
Index: trunk/phase3/includes/api/ApiRollback.php
@@ -38,10 +38,6 @@
3939
4040 public function execute() {
4141 $params = $this->extractRequestParams();
42 -
43 - if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
44 - $this->dieUsageMsg( array( 'show' ) );
45 - }
4642
4743 $titleObj = null;
4844 if ( !isset( $params['title'] ) ) {
@@ -76,12 +72,6 @@
7773 // We don't care about multiple errors, just report one of them
7874 $this->dieUsageMsg( reset( $retval ) );
7975 }
80 -
81 - if ( $params['watch'] || $wgUser->getOption( 'watchdeletion' ) ) {
82 - $articleObj->doWatch();
83 - } elseif ( $params['unwatch'] ) {
84 - $articleObj->doUnwatch();
85 - }
8676
8777 $info = array(
8878 'title' => $titleObj->getPrefixedText(),
@@ -109,9 +99,7 @@
110100 'user' => null,
111101 'token' => null,
112102 'summary' => null,
113 - 'markbot' => false,
114 - 'watch' => false,
115 - 'unwatch' => false,
 103+ 'markbot' => false
116104 );
117105 }
118106
@@ -121,9 +109,7 @@
122110 'user' => 'Name of the user whose edits are to be rolled back. If set incorrectly, you\'ll get a badtoken error.',
123111 'token' => 'A rollback token previously retrieved through prop=revisions',
124112 'summary' => 'Custom edit summary. If not set, default summary will be used.',
125 - 'markbot' => 'Mark the reverted edits and the revert as bot edits',
126 - 'watch' => 'Add the page to your watchlist',
127 - 'unwatch' => 'Remove the page from your watchlist',
 113+ 'markbot' => 'Mark the reverted edits and the revert as bot edits'
128114 );
129115 }
130116
@@ -141,7 +127,6 @@
142128 array( 'invalidtitle', 'title' ),
143129 array( 'notanarticle' ),
144130 array( 'invaliduser', 'user' ),
145 - array( 'show' ),
146131 ) );
147132 }
148133
Index: trunk/phase3/includes/api/ApiDelete.php
@@ -52,10 +52,6 @@
5353 $params = $this->extractRequestParams();
5454
5555 $this->requireOnlyOneParameter( $params, 'title', 'pageid' );
56 -
57 - if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
58 - $this->dieUsageMsg( array( 'show' ) );
59 - }
6056
6157 if ( isset( $params['title'] ) ) {
6258 $titleObj = Title::newFromText( $params['title'] );
@@ -231,7 +227,6 @@
232228 array( 'nosuchpageid', 'pageid' ),
233229 array( 'notanarticle' ),
234230 array( 'hookaborted', 'error' ),
235 - array( 'show' ),
236231 ) );
237232 }
238233
Index: trunk/phase3/includes/api/ApiUndelete.php
@@ -39,10 +39,6 @@
4040 public function execute() {
4141 global $wgUser;
4242 $params = $this->extractRequestParams();
43 -
44 - if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
45 - $this->dieUsageMsg( array( 'show' ) );
46 - }
4743
4844 $titleObj = null;
4945 if ( !isset( $params['title'] ) ) {
@@ -81,14 +77,6 @@
8278 $this->dieUsageMsg( array( 'cannotundelete' ) );
8379 }
8480
85 - if ( $params['watch'] ) {
86 - $articleObj = new Article( $titleObj );
87 - $articleObj->doWatch();
88 - } elseif ( $params['unwatch'] ) {
89 - $articleObj = new Article( $titleObj );
90 - $articleObj->doUnwatch();
91 - }
92 -
9381 if ( $retval[1] ) {
9482 wfRunHooks( 'FileUndeleteComplete',
9583 array( $titleObj, array(), $wgUser, $params['reason'] ) );
@@ -116,9 +104,7 @@
117105 'reason' => '',
118106 'timestamps' => array(
119107 ApiBase::PARAM_ISMULTI => true
120 - ),
121 - 'watch' => false,
122 - 'unwatch' => false,
 108+ )
123109 );
124110 }
125111
@@ -127,9 +113,7 @@
128114 'title' => 'Title of the page you want to restore.',
129115 'token' => 'An undelete token previously retrieved through list=deletedrevs',
130116 'reason' => 'Reason for restoring (optional)',
131 - 'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.',
132 - 'watch' => 'Add the page to your watchlist',
133 - 'unwatch' => 'Remove the page from your watchlist',
 117+ 'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.'
134118 );
135119 }
136120
@@ -147,7 +131,6 @@
148132 array( 'blockedtext' ),
149133 array( 'invalidtitle', 'title' ),
150134 array( 'cannotundelete' ),
151 - array( 'show' ),
152135 ) );
153136 }
154137
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -47,10 +47,6 @@
4848
4949 $this->mParams = $this->extractRequestParams();
5050 $request = $this->getMain()->getRequest();
51 -
52 - if ( isset( $this->mParams['watch'] ) && isset( $this->mParams['unwatch'] ) ) {
53 - $this->dieUsageMsg( array( 'show' ) );
54 - }
5551
5652 // Add the uploaded file to the params array
5753 $this->mParams['file'] = $request->getFileName( 'file' );
@@ -226,10 +222,6 @@
227223 // No errors, no warnings: do the upload
228224 $status = $this->mUpload->performUpload( $this->mParams['comment'],
229225 $this->mParams['text'], $this->mParams['watch'], $wgUser );
230 -
231 - if ( $this->mParams['unwatch'] ) {
232 - $wgUser->removeWatch( $file->getTitle() );
233 - }
234226
235227 if ( !$status->isGood() ) {
236228 $error = $status->getErrorsArray();
@@ -263,7 +255,6 @@
264256 'text' => null,
265257 'token' => null,
266258 'watch' => false,
267 - 'unwatch' => false,
268259 'ignorewarnings' => false,
269260 'file' => null,
270261 'url' => null,
@@ -279,7 +270,6 @@
280271 'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified',
281272 'text' => 'Initial page text for new files',
282273 'watch' => 'Watch the page',
283 - 'watch' => 'Unwatch the page',
284274 'ignorewarnings' => 'Ignore any warnings',
285275 'file' => 'File contents',
286276 'url' => 'Url to fetch the file from',
@@ -312,7 +302,6 @@
313303 array( 'mustbeloggedin', 'upload' ),
314304 array( 'badaccess-groups' ),
315305 array( 'badaccess-groups' ),
316 - array( 'show' ),
317306 array( 'code' => 'fetchfileerror', 'info' => '' ),
318307 array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
319308 array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),

Status & tagging log