From 7690ab4e33eafdcd0aa0a3eb85f47738204d52bf Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Wed, 2 Nov 2022 18:22:08 +0100 Subject: [PATCH] Reorg: Move HeaderCallback to Request directory Cleaning root of includes/ Bug: T321882 Change-Id: I1844da95d4fd79824646fdf4b6063cb771ca3000 --- autoload.php | 1 + includes/GlobalFunctions.php | 2 +- includes/{ => Request}/HeaderCallback.php | 4 +++- includes/ResourceLoader/ResourceLoader.php | 2 +- includes/Setup.php | 2 +- includes/WebResponse.php | 2 +- includes/libs/HttpStatus.php | 2 +- tests/phpunit/unit/includes/HeaderCallbackTest.php | 4 ++-- thumb.php | 4 ++-- 9 files changed, 13 insertions(+), 10 deletions(-) rename includes/{ => Request}/HeaderCallback.php (97%) diff --git a/autoload.php b/autoload.php index 5ae5ac98782..76aaf7d23ff 100644 --- a/autoload.php +++ b/autoload.php @@ -853,6 +853,7 @@ $wgAutoloadLocalClasses = [ 'MediaWiki\\Debug\\DeprecatablePropertyArray' => __DIR__ . '/includes/debug/DeprecatablePropertyArray.php', 'MediaWiki\\Export\\WikiExporterFactory' => __DIR__ . '/includes/export/WikiExporterFactory.php', 'MediaWiki\\FileBackend\\FSFile\\TempFSFileFactory' => __DIR__ . '/includes/libs/filebackend/fsfile/TempFSFileFactory.php', + 'MediaWiki\\HeaderCallback' => __DIR__ . '/includes/Request/HeaderCallback.php', 'MediaWiki\\Hook\\AbortEmailNotificationHook' => __DIR__ . '/includes/changes/Hook/AbortEmailNotificationHook.php', 'MediaWiki\\Hook\\AbortTalkPageEmailNotificationHook' => __DIR__ . '/includes/mail/Hook/AbortTalkPageEmailNotificationHook.php', 'MediaWiki\\Hook\\ActionBeforeFormDisplayHook' => __DIR__ . '/includes/actions/Hook/ActionBeforeFormDisplayHook.php', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ba1f77133e4..7b437f8c616 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1287,7 +1287,7 @@ function wfHttpError( $code, $label, $desc ) { $wgOut->sendCacheControl(); } - MediaWiki\HeaderCallback::warnIfHeadersSent(); + \MediaWiki\Request\HeaderCallback::warnIfHeadersSent(); header( 'Content-type: text/html; charset=utf-8' ); ob_start(); print '' . diff --git a/includes/HeaderCallback.php b/includes/Request/HeaderCallback.php similarity index 97% rename from includes/HeaderCallback.php rename to includes/Request/HeaderCallback.php index 80a4945f0ae..6972cf33474 100644 --- a/includes/HeaderCallback.php +++ b/includes/Request/HeaderCallback.php @@ -1,6 +1,6 @@ execute(); - MediaWiki\HeaderCallback::warnIfHeadersSent(); + \MediaWiki\Request\HeaderCallback::warnIfHeadersSent(); // Simply serve the response from the proxied service as-is header( 'HTTP/1.1 ' . $req->getStatus() ); @@ -654,7 +654,7 @@ function wfThumbErrorText( $status, $msgText ) { function wfThumbError( $status, $msgHtml, $msgText = null, $context = [] ) { global $wgShowHostnames; - MediaWiki\HeaderCallback::warnIfHeadersSent(); + \MediaWiki\Request\HeaderCallback::warnIfHeadersSent(); if ( headers_sent() ) { LoggerFactory::getInstance( 'thumbnail' )->error(