r89505 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89504‎ | r89505 | r89506 >
Date:15:10, 5 June 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 29265) Mediawiki API documentation incomplete

Add text about erroneous requests when sent to the api

Remove extra //, and add some documentation
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -295,6 +295,8 @@
296296 *
297297 * Cache control values set here will only be used if the cache mode is not
298298 * private, see setCacheMode().
 299+ *
 300+ * @param $directives array
299301 */
300302 public function setCacheControl( $directives ) {
301303 $this->mCacheControl = $directives + $this->mCacheControl;
@@ -359,11 +361,9 @@
360362 wfDebugLog( 'exception', $e->getLogMessage() );
361363 }
362364
363 - //
364365 // Handle any kind of exception by outputing properly formatted error message.
365366 // If this fails, an unhandled exception should be thrown so that global error
366367 // handler will process and log it.
367 - //
368368
369369 $errCode = $this->substituteResultWithError( $e );
370370
@@ -601,7 +601,6 @@
602602 return true;
603603 }
604604
605 -
606605 /**
607606 * Check for sufficient permissions to execute
608607 * @param $module ApiBase An Api module
@@ -786,9 +785,16 @@
787786 '**********************************************************************************************************',
788787 '',
789788 'Status: All features shown on this page should be working, but the API',
790 - ' is still in active development, and may change at any time.',
 789+ ' is still in active development, and may change at any time.',
791790 ' Make sure to monitor our mailing list for any updates',
792791 '',
 792+ 'Erroneous requests: When erroneous are sent to the API, a HTTP header will be sent',
 793+ ' with the key "MediaWiki-API-Error" and then both the value of the',
 794+ ' header and the error code sent back will be set to the same value',
 795+ '',
 796+ ' In the case of an invalid action being passed, these will have a value',
 797+ ' of "unknown_action"',
 798+ '',
793799 'Documentation: http://www.mediawiki.org/wiki/API',
794800 'Mailing list: http://lists.wikimedia.org/mailman/listinfo/mediawiki-api',
795801 'Api Announcements: http://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce',
@@ -1023,10 +1029,16 @@
10241030 $this->mExtraData = $extradata;
10251031 }
10261032
 1033+ /**
 1034+ * @return string
 1035+ */
10271036 public function getCodeString() {
10281037 return $this->mCodestr;
10291038 }
10301039
 1040+ /**
 1041+ * @return array
 1042+ */
10311043 public function getMessageArray() {
10321044 $result = array(
10331045 'code' => $this->mCodestr,
@@ -1038,6 +1050,9 @@
10391051 return $result;
10401052 }
10411053
 1054+ /**
 1055+ * @return string
 1056+ */
10421057 public function __toString() {
10431058 return "{$this->getCodeString()}: {$this->getMessage()}";
10441059 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r89506Add missing word to r89505reedy15:12, 5 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89461* (bug 29265) Mediawiki API documentation incomplete...reedy11:31, 4 June 2011

Status & tagging log