From a31d9c90671e0c74d4cdde1457b734c5f4b67505 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Jun 2007 22:05:30 +0000 Subject: [PATCH] API: Minor cleanup --- includes/api/ApiFormatBase.php | 1 - includes/api/ApiMain.php | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index f1fbc0e0ab..9fa17e41ec 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -249,4 +249,3 @@ class ApiFormatFeedWrapper extends ApiFormatBase { return __CLASS__ . ': $Id$'; } } -?> diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index dc2a697fa9..72d09bf6a6 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -77,7 +77,7 @@ class ApiMain extends ApiBase { ); private $mPrinter, $mModules, $mModuleNames, $mFormats, $mFormatNames; - private $mResult, $mShowVersions, $mEnableWrite, $mRequest, $mInternalMode, $mSquidMaxage; + private $mResult, $mAction, $mShowVersions, $mEnableWrite, $mRequest, $mInternalMode, $mSquidMaxage; /** * Constructs an instance of ApiMain that utilizes the module and format specified by $request. @@ -197,7 +197,7 @@ class ApiMain extends ApiBase { 'code' => $e->getCodeString(), 'info' => $e->getMessage()); // Only print the help message when this is for the developer, not runtime - if ($this->mPrinter->getIsHtml() || $this->getRequest()->getVal('action') == 'help') + if ($this->mPrinter->getIsHtml() || $this->mAction == 'help') ApiResult :: setContent($errMessage, $this->makeHelpMsg()); } else { @@ -247,10 +247,10 @@ class ApiMain extends ApiBase { $params = $this->extractRequestParams(); $this->mShowVersions = $params['version']; - $action = $params['action']; + $this->mAction = $params['action']; // Instantiate the module requested by the user - $module = new $this->mModules[$action] ($this, $action); + $module = new $this->mModules[$this->mAction] ($this, $this->mAction); if (!$this->mInternalMode) { -- 2.20.1