From 2cd44197fc941b942ca1dcc48fdb565671b0d50d Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Thu, 27 Oct 2011 01:13:19 +0000 Subject: [PATCH] Followup r100905, cleanup per CR and fixes the overriding of the main RequestContext --- includes/api/ApiMain.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 070460c70c..982ad2fcc4 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -151,11 +151,14 @@ class ApiMain extends ApiBase { // BC for pre-1.19 $request = $context; $context = RequestContext::getMain(); - $context->setRequest( $request ); } // We set a derivative context so we can change stuff later $this->setContext( new DerivativeContext( $context ) ); + if ( isset( $request ) ) { + $context->setRequest( $request ); + } + $this->mInternalMode = ( $this->getRequest() instanceof FauxRequest ); // Special handling for the main module: $parent === $this @@ -187,8 +190,6 @@ class ApiMain extends ApiBase { $this->mShowVersions = false; $this->mEnableWrite = $enableWrite; - //$this->mRequest = &$request; - $this->mSquidMaxage = - 1; // flag for executeActionWithErrorHandling() $this->mCommit = false; } @@ -201,14 +202,6 @@ class ApiMain extends ApiBase { return $this->mInternalMode; } - /** - * Return the request object that contains client's request - * @return WebRequest - */ - /*public function getRequest() { - return $this->mRequest; - }*/ - /** * Get the ApiResult object associated with current request * -- 2.20.1