\r
if (!defined('MEDIAWIKI')) {\r
// Eclipse helper - will be ignored in production\r
- require_once ("ApiBase.php");\r
+ require_once ('ApiBase.php');\r
}\r
\r
class ApiMain extends ApiBase {\r
$this->mResult = new ApiResult($this);\r
}\r
\r
- public function getResult() {\r
+ public function & getResult() {\r
return $this->mResult;\r
}\r
\r
\r
public function mainDieUsage($description, $errorCode, $httpRespCode = 0) {\r
$this->mResult->Reset();\r
- $this->mResult->addMessage('error', null, $errorCode);\r
if ($httpRespCode === 0)\r
header($errorCode, true);\r
else\r
header($errorCode, true, $httpRespCode);\r
\r
- $this->mResult->addMessage('usage', null, $this->makeHelpMsg());\r
+ $data = array (\r
+ 'code' => $errorCode\r
+ );\r
+ ApiResult :: addContent($data, $this->makeHelpMsg());\r
+ $this->mResult->addValue(null, 'error', $data);\r
\r
throw new UsageException($description, $errorCode);\r
}\r
return "{$this->codestr}: {$this->message}";\r
}\r
}\r
-\r
?>
\ No newline at end of file