From 6bf78b327410c401798a1961910da80dc9d26440 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Mon, 6 Apr 2015 14:13:14 -0600 Subject: [PATCH] Separate Monolog shims from other logging shims Move the non-namespaced classes referencing external Monolog classes to an isolated PHP source file so that they aren't brought into scope by the need to load another shim class. Bug: T95220 Change-Id: I8270b8d5cd25db5a0f84fa94f59a6555052ae1ae --- autoload.php | 10 ++-- includes/debug/logger/Shims.php | 50 ------------------ includes/debug/logger/monolog/Shims.php | 69 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 55 deletions(-) create mode 100644 includes/debug/logger/monolog/Shims.php diff --git a/autoload.php b/autoload.php index d646a0e8bb..1e62ccca8a 100644 --- a/autoload.php +++ b/autoload.php @@ -698,11 +698,11 @@ $wgAutoloadLocalClasses = array( 'MWLoggerFactory' => __DIR__ . '/includes/debug/logger/Shims.php', 'MWLoggerLegacyLogger' => __DIR__ . '/includes/debug/logger/Shims.php', 'MWLoggerLegacySpi' => __DIR__ . '/includes/debug/logger/Shims.php', - 'MWLoggerMonologHandler' => __DIR__ . '/includes/debug/logger/Shims.php', - 'MWLoggerMonologLegacyFormatter' => __DIR__ . '/includes/debug/logger/Shims.php', - 'MWLoggerMonologProcessor' => __DIR__ . '/includes/debug/logger/Shims.php', - 'MWLoggerMonologSpi' => __DIR__ . '/includes/debug/logger/Shims.php', - 'MWLoggerMonologSyslogHandler' => __DIR__ . '/includes/debug/logger/Shims.php', + 'MWLoggerMonologHandler' => __DIR__ . '/includes/debug/logger/monolog/Shims.php', + 'MWLoggerMonologLegacyFormatter' => __DIR__ . '/includes/debug/logger/monolog/Shims.php', + 'MWLoggerMonologProcessor' => __DIR__ . '/includes/debug/logger/monolog/Shims.php', + 'MWLoggerMonologSpi' => __DIR__ . '/includes/debug/logger/monolog/Shims.php', + 'MWLoggerMonologSyslogHandler' => __DIR__ . '/includes/debug/logger/monolog/Shims.php', 'MWLoggerNullSpi' => __DIR__ . '/includes/debug/logger/Shims.php', 'MWLoggerSpi' => __DIR__ . '/includes/debug/logger/Shims.php', 'MWMemcached' => __DIR__ . '/includes/objectcache/MemcachedClient.php', diff --git a/includes/debug/logger/Shims.php b/includes/debug/logger/Shims.php index c78b0dce4d..0476d0ff55 100644 --- a/includes/debug/logger/Shims.php +++ b/includes/debug/logger/Shims.php @@ -100,56 +100,6 @@ class MWLoggerLegacyLogger extends \MediaWiki\Logger\LegacyLogger { class MWLoggerLegacySpi extends \MediaWiki\Logger\LegacySpi { } -/** - * Backwards compatibility stub for usage from before the introduction of - * the MediaWiki\Logger namespace. - * - * @deprecated since 1.25 Use \MediaWiki\Logger\Monolog\LegacyHandler - * @todo This class should be removed before the 1.25 final release. - */ -class MWLoggerMonologHandler extends \MediaWiki\Logger\Monolog\LegacyHandler { -} - -/** - * Backwards compatibility stub for usage from before the introduction of - * the MediaWiki\Logger namespace. - * - * @deprecated since 1.25 Use \MediaWiki\Logger\Monolog\LegacyFormatter - * @todo This class should be removed before the 1.25 final release. - */ -class MWLoggerMonologLegacyFormatter extends \MediaWiki\Logger\Monolog\LegacyFormatter { -} - -/** - * Backwards compatibility stub for usage from before the introduction of - * the MediaWiki\Logger namespace. - * - * @deprecated since 1.25 Use \MediaWiki\Logger\Monolog\WikiProcessor - * @todo This class should be removed before the 1.25 final release. - */ -class MWLoggerMonologProcessor extends \MediaWiki\Logger\Monolog\WikiProcessor { -} - -/** - * Backwards compatibility stub for usage from before the introduction of - * the MediaWiki\Logger namespace. - * - * @deprecated since 1.25 Use \MediaWiki\Logger\MonologSpi - * @todo This class should be removed before the 1.25 final release. - */ -class MWLoggerMonologSpi extends \MediaWiki\Logger\MonologSpi { -} - -/** - * Backwards compatibility stub for usage from before the introduction of - * the MediaWiki\Logger namespace. - * - * @deprecated since 1.25 Use \MediaWiki\Logger\Monolog\SyslogHandler - * @todo This class should be removed before the 1.25 final release. - */ -class MWLoggerMonologSyslogHandler extends \MediaWiki\Logger\Monolog\SyslogHandler { -} - /** * Backwards compatibility stub for usage from before the introduction of * the MediaWiki\Logger namespace. diff --git a/includes/debug/logger/monolog/Shims.php b/includes/debug/logger/monolog/Shims.php new file mode 100644 index 0000000000..f250713d4c --- /dev/null +++ b/includes/debug/logger/monolog/Shims.php @@ -0,0 +1,69 @@ +