Merge "resources: Update mustache.js from 0.8.2-d9aa703 to v1.0.0"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 23 Sep 2018 20:41:49 +0000 (20:41 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 23 Sep 2018 20:41:49 +0000 (20:41 +0000)
RELEASE-NOTES-1.32
autoload.php
docs/hooks.txt
includes/DefaultSettings.php
includes/MimeMagic.php [deleted file]
includes/ServiceWiring.php
includes/filerepo/file/LocalFile.php
includes/utils/MWFileProps.php

index 7a3cb15..cfe90a0 100644 (file)
@@ -316,6 +316,8 @@ because of Phabricator reports.
   behaviour which has been deprecated since 1.24.
 * LBFactory, deprecated since 1.28, has been removed. Instead, use
   Wikimedia\Rdbms\LBFactory.
+* The MimeMagic class, deprecated since 1.28 has been removed. Get a
+  MimeAnalyzer instance from MediaWikiServices instead.
 
 === Deprecations in 1.32 ===
 * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit
index 96a7dc3..f63ccb5 100644 (file)
@@ -950,7 +950,6 @@ $wgAutoloadLocalClasses = [
        'MigrateFileRepoLayout' => __DIR__ . '/maintenance/migrateFileRepoLayout.php',
        'MigrateUserGroup' => __DIR__ . '/maintenance/migrateUserGroup.php',
        'MimeAnalyzer' => __DIR__ . '/includes/libs/mime/MimeAnalyzer.php',
-       'MimeMagic' => __DIR__ . '/includes/MimeMagic.php',
        'MinifyScript' => __DIR__ . '/maintenance/minify.php',
        'MostcategoriesPage' => __DIR__ . '/includes/specials/SpecialMostcategories.php',
        'MostimagesPage' => __DIR__ . '/includes/specials/SpecialMostimages.php',
index 8223814..063bbe5 100644 (file)
@@ -2353,7 +2353,7 @@ $title: title of the message (string)
 $code: code (string) denoting the language to try.
 
 'MimeMagicGuessFromContent': Allows MW extensions guess the MIME by content.
-$mimeMagic: Instance of MimeMagic.
+$mimeMagic: Instance of MimeAnalyzer.
 &$head: First 1024 bytes of the file in a string (in - Do not alter!).
 &$tail: More or equal than last 65558 bytes of the file in a string
   (in - Do not alter!).
@@ -2362,7 +2362,7 @@ $file: File path.
 
 'MimeMagicImproveFromExtension': Allows MW extensions to further improve the
 MIME type detected by considering the file extension.
-$mimeMagic: Instance of MimeMagic.
+$mimeMagic: Instance of MimeAnalyzer.
 $ext: File extension.
 &$mime: MIME type (in/out).
 
@@ -2370,7 +2370,7 @@ $ext: File extension.
 and the list mapping MIME types to file extensions.
 As an extension author, you are encouraged to submit patches to MediaWiki's
 core to add new MIME types to mime.types.
-$mimeMagic: Instance of MimeMagic.
+$mimeMagic: Instance of MimeAnalyzer.
   Use $mimeMagic->addExtraInfo( $stringOfInfo );
   for adding new MIME info to the list.
   Use $mimeMagic->addExtraTypes( $stringOfTypes );
index d335dcc..3ef5243 100644 (file)
@@ -1380,14 +1380,14 @@ $wgAntivirusRequired = true;
 $wgVerifyMimeType = true;
 
 /**
- * Sets the MIME type definition file to use by MimeMagic.php.
+ * Sets the MIME type definition file to use by includes/libs/mime/MimeAnalyzer.php.
  * Set to null, to use built-in defaults only.
  * example: $wgMimeTypeFile = '/etc/mime.types';
  */
 $wgMimeTypeFile = 'includes/mime.types';
 
 /**
- * Sets the MIME type info file to use by MimeMagic.php.
+ * Sets the MIME type info file to use by includes/libs/mime/MimeAnalyzer.php.
  * Set to null, to use built-in defaults only.
  */
 $wgMimeInfoFile = 'includes/mime.info';
diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php
deleted file mode 100644 (file)
index 6152d22..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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
- */
-use MediaWiki\MediaWikiServices;
-use Wikimedia\Assert\Assert;
-
-/**
- * @deprecated since 1.29
- * MimeAnalyzer should be used instead of MimeMagic
- */
-class MimeMagic extends MimeAnalyzer {
-       /**
-        * Get an instance of this class
-        * @return MimeMagic
-        * @deprecated since 1.28 get a MimeAnalyzer instance from MediaWikiServices
-        */
-       public static function singleton() {
-               wfDeprecated( __METHOD__, '1.28' );
-               // XXX: We know that the MimeAnalyzer is currently an instance of MimeMagic
-               $instance = MediaWikiServices::getInstance()->getMimeAnalyzer();
-               Assert::postcondition(
-                       $instance instanceof MimeMagic,
-                       __METHOD__ . ' should return an instance of ' . self::class
-               );
-               return $instance;
-       }
-}
index b8bd5d2..cf2def2 100644 (file)
@@ -321,8 +321,7 @@ return [
                        };
                }
 
-               // XXX: MimeMagic::singleton currently requires this service to return an instance of MimeMagic
-               return new MimeMagic( $params );
+               return new MimeAnalyzer( $params );
        },
 
        'NameTableStoreFactory' => function ( MediaWikiServices $services ) : NameTableStoreFactory {
index fa6e180..b6c249b 100644 (file)
@@ -63,7 +63,7 @@ class LocalFile extends File {
        /** @var string MEDIATYPE_xxx (bitmap, drawing, audio...) */
        protected $media_type;
 
-       /** @var string MIME type, determined by MimeMagic::guessMimeType */
+       /** @var string MIME type, determined by MimeAnalyzer::guessMimeType */
        protected $mime;
 
        /** @var int Size in bytes (loadFromXxx) */
index 9d05c6a..a20435e 100644 (file)
@@ -26,7 +26,7 @@
  * @since 1.28
  */
 class MWFileProps {
-       /** @var MimeMagic */
+       /** @var MimeAnalyzer */
        private $magic;
 
        /**