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
'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',
$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!).
'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).
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 );
$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';
+++ /dev/null
-<?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;
- }
-}
};
}
- // 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 {
/** @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) */
* @since 1.28
*/
class MWFileProps {
- /** @var MimeMagic */
+ /** @var MimeAnalyzer */
private $magic;
/**