r98946 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98945‎ | r98946 | r98947 >
Date:22:42, 4 October 2011
Author:reedy
Status:deferred
Tags:
Comment:
Bug 31356 - [MirrorTools] Some api functions are not public

Patch by Samuel Lampa
Modified paths:
  • /trunk/extensions/MirrorTools/APIMirrorTools.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MirrorTools/APIMirrorTools.php
@@ -39,7 +39,7 @@
4040 public function execute() {
4141 global $wgUser;
4242 $params = $this->extractRequestParams();
43 -
 43+
4444 if ( is_null( $params['user'] ) ) {
4545 $this->dieUsageMsg( array( 'missingparam', 'user' ) );
4646 }
@@ -327,11 +327,11 @@
328328
329329 case EditPage::AS_END:
330330 // This usually means some kind of race condition
331 - // or DB weirdness occurred.
 331+ // or DB weirdness occurred.
332332 if ( is_array( $result ) && count( $result ) > 0 ) {
333 - $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) );
 333+ $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) );
334334 }
335 -
 335+
336336 // Unknown error, but no specific error message
337337 // Fall through
338338 default:
@@ -340,25 +340,25 @@
341341 $this->getResult()->addValue( null, $this->getModuleName(), $r );
342342 }
343343
344 - protected function getDescription() {
 344+ public function getDescription() {
345345 return 'Create and edit pages using any username.';
346346 }
347 -
 347+
348348 public function getPossibleErrors() {
349349 return array_merge( parent::getPossibleErrors(), array(
350350 array( 'missingparam', 'user' ),
351351 ) );
352352 }
353353
354 - protected function getAllowedParams() {
 354+ public function getAllowedParams() {
355355 return array_merge( array( 'user' => null ), parent::getAllowedParams() );
356356 }
357357
358 - protected function getParamDescription() {
 358+ public function getParamDescription() {
359359 return array_merge( array( 'user' => 'Username' ), parent::getParamDescription() );
360360 }
361361
362 - protected function getExamples() {
 362+ public function getExamples() {
363363 return array(
364364 'Edit a page (anonymous user):',
365365 ' api.php?action=edit&title=Test&summary=test%20summary&text=article%20content&basetimestamp=20070824123454&token=%2B\\',

Status & tagging log