Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -151,11 +151,14 @@ |
152 | 152 | // BC for pre-1.19 |
153 | 153 | $request = $context; |
154 | 154 | $context = RequestContext::getMain(); |
155 | | - $context->setRequest( $request ); |
156 | 155 | } |
157 | 156 | // We set a derivative context so we can change stuff later |
158 | 157 | $this->setContext( new DerivativeContext( $context ) ); |
159 | 158 | |
| 159 | + if ( isset( $request ) ) { |
| 160 | + $context->setRequest( $request ); |
| 161 | + } |
| 162 | + |
160 | 163 | $this->mInternalMode = ( $this->getRequest() instanceof FauxRequest ); |
161 | 164 | |
162 | 165 | // Special handling for the main module: $parent === $this |
— | — | @@ -187,8 +190,6 @@ |
188 | 191 | $this->mShowVersions = false; |
189 | 192 | $this->mEnableWrite = $enableWrite; |
190 | 193 | |
191 | | - //$this->mRequest = &$request; |
192 | | - |
193 | 194 | $this->mSquidMaxage = - 1; // flag for executeActionWithErrorHandling() |
194 | 195 | $this->mCommit = false; |
195 | 196 | } |
— | — | @@ -202,14 +203,6 @@ |
203 | 204 | } |
204 | 205 | |
205 | 206 | /** |
206 | | - * Return the request object that contains client's request |
207 | | - * @return WebRequest |
208 | | - */ |
209 | | - /*public function getRequest() { |
210 | | - return $this->mRequest; |
211 | | - }*/ |
212 | | - |
213 | | - /** |
214 | 207 | * Get the ApiResult object associated with current request |
215 | 208 | * |
216 | 209 | * @return ApiResult |