From: John Du Hart Date: Thu, 27 Oct 2011 01:13:19 +0000 (+0000) Subject: Followup r100905, cleanup per CR and fixes the overriding of the main RequestContext X-Git-Tag: 1.31.0-rc.0~26890 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=2cd44197fc941b942ca1dcc48fdb565671b0d50d;p=lhc%2Fweb%2Fwiklou.git Followup r100905, cleanup per CR and fixes the overriding of the main RequestContext --- 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 *