Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -146,8 +146,7 @@ |
147 | 147 | return; // skip any initialization |
148 | 148 | } |
149 | 149 | |
150 | | - global $wgRequest; |
151 | | - $wgRequest->response()->header( "Content-Type: $mime; charset=utf-8" ); |
| 150 | + $this->getMain()->getRequest()->response()->header( "Content-Type: $mime; charset=utf-8" ); |
152 | 151 | |
153 | 152 | if ( $isHtml ) { |
154 | 153 | ?> |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -370,8 +370,7 @@ |
371 | 371 | // Error results should not be cached |
372 | 372 | $this->setCacheMode( 'private' ); |
373 | 373 | |
374 | | - global $wgRequest; |
375 | | - $response = $wgRequest->response(); |
| 374 | + $response = $this->getRequest()->response(); |
376 | 375 | $headerStr = 'MediaWiki-API-Error: ' . $errCode; |
377 | 376 | if ( $e->getCode() === 0 ) { |
378 | 377 | $response->header( $headerStr ); |
— | — | @@ -399,8 +398,7 @@ |
400 | 399 | } |
401 | 400 | |
402 | 401 | protected function sendCacheHeaders() { |
403 | | - global $wgRequest; |
404 | | - $response = $wgRequest->response(); |
| 402 | + $response = $this->getRequest()->response(); |
405 | 403 | |
406 | 404 | if ( $this->mCacheMode == 'private' ) { |
407 | 405 | $response->header( 'Cache-Control: private' ); |
— | — | @@ -572,7 +570,7 @@ |
573 | 571 | $this->dieUsageMsg( array( 'missingparam', 'token' ) ); |
574 | 572 | } else { |
575 | 573 | global $wgUser; |
576 | | - if ( !$wgUser->matchEditToken( $moduleParams['token'], $salt, $this->getMain()->getRequest() ) ) { |
| 574 | + if ( !$wgUser->matchEditToken( $moduleParams['token'], $salt, $this->getRequest() ) ) { |
577 | 575 | $this->dieUsageMsg( 'sessionfailure' ); |
578 | 576 | } |
579 | 577 | } |
— | — | @@ -593,8 +591,7 @@ |
594 | 592 | $maxLag = $params['maxlag']; |
595 | 593 | list( $host, $lag ) = wfGetLB()->getMaxLag(); |
596 | 594 | if ( $lag > $maxLag ) { |
597 | | - global $wgRequest; |
598 | | - $response = $wgRequest->response(); |
| 595 | + $response = $this->getRequest()->response(); |
599 | 596 | |
600 | 597 | $response->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) ); |
601 | 598 | $response->header( 'X-Database-Lag: ' . intval( $lag ) ); |
— | — | @@ -867,7 +864,7 @@ |
868 | 865 | // Get help text from cache if present |
869 | 866 | $key = wfMemcKey( 'apihelp', $this->getModuleName(), |
870 | 867 | SpecialVersion::getVersion( 'nodb' ) . |
871 | | - $this->getMain()->getShowVersions() ); |
| 868 | + $this->getShowVersions() ); |
872 | 869 | if ( $wgAPICacheHelpTimeout > 0 ) { |
873 | 870 | $cached = $wgMemc->get( $key ); |
874 | 871 | if ( $cached ) { |