Separate Monolog shims from other logging shims
authorBryan Davis <bd808@wikimedia.org>
Mon, 6 Apr 2015 20:13:14 +0000 (14:13 -0600)
committerBryanDavis <bdavis@wikimedia.org>
Mon, 6 Apr 2015 20:28:13 +0000 (20:28 +0000)
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
includes/debug/logger/Shims.php
includes/debug/logger/monolog/Shims.php [new file with mode: 0644]

index d646a0e..1e62ccc 100644 (file)
@@ -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',
index c78b0dc..0476d0f 100644 (file)
@@ -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 (file)
index 0000000..f250713
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * 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 {
+}