* @file
*/
+use MediaWiki\Logger\LoggerFactory;
+
/**
* This class should be covered by a general architecture document which does
* not exist as of January 2011. This is one of the Core classes and should
}
# Not modified
- # Give a 304 response code and disable body output
+ # Give a 304 Not Modified response code and disable body output
wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", 'log' );
ini_set( 'zlib.output_compression', 0 );
- $this->getRequest()->response()->header( "HTTP/1.1 304 Not Modified" );
+ $this->getRequest()->response()->statusHeader( 304 );
$this->sendCacheControl();
$this->disable();
if ( Hooks::run( "BeforePageRedirect", array( $this, &$redirect, &$code ) ) ) {
if ( $code == '301' || $code == '303' ) {
if ( !$config->get( 'DebugRedirects' ) ) {
- $message = HttpStatus::getMessage( $code );
- $response->header( "HTTP/1.1 $code $message" );
+ $response->statusHeader( $code );
}
$this->mLastModified = wfTimestamp( TS_RFC2822 );
}
return;
} elseif ( $this->mStatusCode ) {
- $message = HttpStatus::getMessage( $this->mStatusCode );
- if ( $message ) {
- $response->header( 'HTTP/1.1 ' . $this->mStatusCode . ' ' . $message );
- }
+ $response->statusHeader( $this->mStatusCode );
}
# Buffer output; final headers may depend on later processing
*/
public function getResourceLoader() {
if ( is_null( $this->mResourceLoader ) ) {
- $this->mResourceLoader = new ResourceLoader( $this->getConfig() );
+ $this->mResourceLoader = new ResourceLoader(
+ $this->getConfig(),
+ LoggerFactory::getInstance( 'resourceloader' )
+ );
}
return $this->mResourceLoader;
}
// Load embeddable private modules before any loader links
// This needs to be TYPE_COMBINED so these modules are properly wrapped
// in mw.loader.implement() calls and deferred until mw.user is available
- $embedScripts = array( 'user.options', 'user.tokens' );
+ $embedScripts = array( 'user.options' );
$links[] = $this->makeResourceLoaderLink( $embedScripts, ResourceLoaderModule::TYPE_COMBINED );
+ // Separate user.tokens as otherwise caching will be allowed (T84960)
+ $links[] = $this->makeResourceLoaderLink( 'user.tokens', ResourceLoaderModule::TYPE_COMBINED );
// Scripts and messages "only" requests marked for top inclusion
$links[] = $this->makeResourceLoaderLink(