Index: trunk/extensions/MirrorTools/APIMirrorTools.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | public function execute() { |
41 | 41 | global $wgUser; |
42 | 42 | $params = $this->extractRequestParams(); |
43 | | - |
| 43 | + |
44 | 44 | if ( is_null( $params['user'] ) ) { |
45 | 45 | $this->dieUsageMsg( array( 'missingparam', 'user' ) ); |
46 | 46 | } |
— | — | @@ -327,11 +327,11 @@ |
328 | 328 | |
329 | 329 | case EditPage::AS_END: |
330 | 330 | // This usually means some kind of race condition |
331 | | - // or DB weirdness occurred. |
| 331 | + // or DB weirdness occurred. |
332 | 332 | if ( is_array( $result ) && count( $result ) > 0 ) { |
333 | | - $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) ); |
| 333 | + $this->dieUsageMsg( array( 'unknownerror', $result[0][0] ) ); |
334 | 334 | } |
335 | | - |
| 335 | + |
336 | 336 | // Unknown error, but no specific error message |
337 | 337 | // Fall through |
338 | 338 | default: |
— | — | @@ -340,25 +340,25 @@ |
341 | 341 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
342 | 342 | } |
343 | 343 | |
344 | | - protected function getDescription() { |
| 344 | + public function getDescription() { |
345 | 345 | return 'Create and edit pages using any username.'; |
346 | 346 | } |
347 | | - |
| 347 | + |
348 | 348 | public function getPossibleErrors() { |
349 | 349 | return array_merge( parent::getPossibleErrors(), array( |
350 | 350 | array( 'missingparam', 'user' ), |
351 | 351 | ) ); |
352 | 352 | } |
353 | 353 | |
354 | | - protected function getAllowedParams() { |
| 354 | + public function getAllowedParams() { |
355 | 355 | return array_merge( array( 'user' => null ), parent::getAllowedParams() ); |
356 | 356 | } |
357 | 357 | |
358 | | - protected function getParamDescription() { |
| 358 | + public function getParamDescription() { |
359 | 359 | return array_merge( array( 'user' => 'Username' ), parent::getParamDescription() ); |
360 | 360 | } |
361 | 361 | |
362 | | - protected function getExamples() { |
| 362 | + public function getExamples() { |
363 | 363 | return array( |
364 | 364 | 'Edit a page (anonymous user):', |
365 | 365 | ' api.php?action=edit&title=Test&summary=test%20summary&text=article%20content&basetimestamp=20070824123454&token=%2B\\', |