Merge "Add lowercase variants to the autoloader for legacy history blob classes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 16 Oct 2017 14:05:20 +0000 (14:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 16 Oct 2017 14:05:20 +0000 (14:05 +0000)
autoload.php
includes/HistoryBlob.php

index a489b8b..83f2519 100644 (file)
@@ -1706,5 +1706,8 @@ $wgAutoloadLocalClasses = [
        'ZhConverter' => __DIR__ . '/languages/classes/LanguageZh.php',
        'ZipDirectoryReader' => __DIR__ . '/includes/utils/ZipDirectoryReader.php',
        'ZipDirectoryReaderError' => __DIR__ . '/includes/utils/ZipDirectoryReaderError.php',
+       'concatenatedgziphistoryblob' => __DIR__ . '/includes/HistoryBlob.php',
+       'historyblobcurstub' => __DIR__ . '/includes/HistoryBlob.php',
+       'historyblobstub' => __DIR__ . '/includes/HistoryBlob.php',
        'profile_point' => __DIR__ . '/profileinfo.php',
 ];
index 51bd7a9..14d22ec 100644 (file)
@@ -699,3 +699,16 @@ class DiffHistoryBlob implements HistoryBlob {
        }
 
 }
+
+// @codingStandardsIgnoreStart
+if ( false ) {
+       // Blobs generated by MediaWiki < 1.5 on PHP 4 were serialized with the
+       // class name coerced to lowercase. We can improve efficiency by adding
+       // autoload entries for the lowercase variants of these classes (T166759).
+       // The code below is never executed, but it is picked up by the AutoloadGenerator
+       // parser, which scans for class_alias() calls.
+       class_alias( 'ConcatenatedGzipHistoryBlob', 'concatenatedgziphistoryblob' );
+       class_alias( 'HistoryBlobCurStub', 'historyblobcurstub' );
+       class_alias( 'HistoryBlobStub', 'historyblobstub' );
+}
+// @codingStandardsIgnoreEnd