From: rillke Date: Thu, 24 Jul 2014 14:04:48 +0000 (+0200) Subject: Unify the spelling of MIME in documentation X-Git-Tag: 1.31.0-rc.0~14525 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=c31fbf073e112526236d3afe6ef4dab3d5cd8e6f;p=lhc%2Fweb%2Fwiklou.git Unify the spelling of MIME in documentation Writing MIME as written in Wikipedia and some documentation clean up. Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 25f5ad88f6..becaf40b22 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2734,11 +2734,11 @@ string &$error: output: message key for message to show if upload canceled by returning false. May also be an array, where the first element is the message key and the remaining elements are used as parameters to the message. -'UploadVerifyFile': extra file verification, based on mime type, etc. Preferred +'UploadVerifyFile': extra file verification, based on MIME type, etc. Preferred in most cases over UploadVerification. object $upload: an instance of UploadBase, with all info about the upload -string $mime: The uploaded file's mime type, as detected by MediaWiki. Handlers - will typically only apply for specific mime types. +string $mime: The uploaded file's MIME type, as detected by MediaWiki. Handlers + will typically only apply for specific MIME types. object &$error: output: true if the file is valid. Otherwise, an indexed array representing the problem with the file, where the first element is the message key and the remaining elements are used as parameters to the message. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index cbcf456c21..94476c5b04 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -758,7 +758,7 @@ $wgFileBlacklist = array( 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' ); /** - * Files with these mime types will never be allowed as uploads + * Files with these MIME types will never be allowed as uploads * if $wgVerifyMimeType is enabled. */ $wgMimeTypeBlacklist = array( @@ -810,7 +810,7 @@ $wgDisableUploadScriptChecks = false; $wgUploadSizeWarning = false; /** - * list of trusted media-types and mime types. + * list of trusted media-types and MIME types. * Use the MEDIATYPE_xxx constants to represent media types. * This list is used by File::isSafeFile * @@ -1133,45 +1133,45 @@ $wgAntivirusSetup = array( $wgAntivirusRequired = true; /** - * Determines if the mime type of uploaded files should be checked + * Determines if the MIME type of uploaded files should be checked */ $wgVerifyMimeType = true; /** - * Sets the mime type definition file to use by MimeMagic.php. + * Sets the MIME type definition file to use by MimeMagic.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 MimeMagic.php. * Set to null, to use built-in defaults only. */ $wgMimeInfoFile = 'includes/mime.info'; /** - * Sets an external mime detector program. The command must print only - * the mime type to standard output. + * Sets an external MIME detector program. The command must print only + * the MIME type to standard output. * The name of the file to process will be appended to the command given here. * If not set or NULL, mime_content_type will be used if available. * * @par Example: * @code - * #$wgMimeDetectorCommand = "file -bi"; # use external mime detector (Linux) + * #$wgMimeDetectorCommand = "file -bi"; # use external MIME detector (Linux) * @endcode */ $wgMimeDetectorCommand = null; /** - * Switch for trivial mime detection. Used by thumb.php to disable all fancy + * Switch for trivial MIME detection. Used by thumb.php to disable all fancy * things, because only a few types of images are needed and file extensions * can be trusted. */ $wgTrivialMimeDetection = false; /** - * Additional XML types we can allow via mime-detection. + * Additional XML types we can allow via MIME-detection. * array = ( 'rootElement' => 'associatedMimeType' ) */ $wgXMLMimeTypes = array( @@ -2926,7 +2926,7 @@ $wgWellFormedXml = true; * Normally we wouldn't have to define this in the root "" * element, but IE needs it there in some circumstances. * - * This is ignored if $wgMimeType is set to a non-XML mimetype. + * This is ignored if $wgMimeType is set to a non-XML MIME type. */ $wgXhtmlNamespaces = array(); diff --git a/includes/Html.php b/includes/Html.php index ce439cb3ee..46bee95650 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -36,7 +36,7 @@ * * There are two important configuration options this class uses: * - * $wgMimeType: If this is set to an xml mimetype then output should be + * $wgMimeType: If this is set to an xml MIME type then output should be * valid XHTML5. * $wgWellFormedXml: If this is set to true, then all output should be * well-formed XML (quotes on attributes, self-closing tags, etc.). @@ -872,7 +872,7 @@ class Html { $isXHTML = self::isXmlMimeType( $wgMimeType ); if ( $isXHTML ) { // XHTML5 - // XML mimetyped markup should have an xml header. + // XML MIME-typed markup should have an xml header. // However a DOCTYPE is not needed. $ret .= "\n"; @@ -904,16 +904,16 @@ class Html { } /** - * Determines if the given mime type is xml. + * Determines if the given MIME type is xml. * - * @param string $mimetype MimeType + * @param string $mimetype MIME type * @return bool */ public static function isXmlMimeType( $mimetype ) { # http://www.whatwg.org/html/infrastructure.html#xml-mime-type # * text/xml # * application/xml - # * Any mimetype with a subtype ending in +xml (this implicitly includes application/xhtml+xml) + # * Any MIME type with a subtype ending in +xml (this implicitly includes application/xhtml+xml) return (bool)preg_match( '!^(text|application)/xml$|^.+/.+\+xml$!', $mimetype ); } diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index b4d3ab1c1e..8f0a2af230 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -1,6 +1,6 @@ ext - * map. Each line contains a mime type followed by a space separated list of - * extensions. If multiple extensions for a single mime type exist or if - * multiple mime types exist for a single extension then in most cases - * MediaWiki assumes that the first extension following the mime type is the - * canonical extension, and the first time a mime type appears for a certain - * extension is considered the canonical mime type. + * This list concatenated with mime.types is used to create a MIME <-> ext + * map. Each line contains a MIME type followed by a space separated list of + * extensions. If multiple extensions for a single MIME type exist or if + * multiple MIME types exist for a single extension then in most cases + * MediaWiki assumes that the first extension following the MIME type is the + * canonical extension, and the first time a MIME type appears for a certain + * extension is considered the canonical MIME type. * * (Note that appending $wgMimeTypeFile to the end of MM_WELL_KNOWN_MIME_TYPES * sucks because you can't redefine canonical types. This could be fixed by @@ -86,9 +86,9 @@ END_STRING ); /** - * Defines a set of well known mime info entries + * Defines a set of well known MIME info entries * This is used as a fallback to mime.info files. - * An extensive list of well known mime types is provided by + * An extensive list of well known MIME types is provided by * the file mime.info in the includes directory. */ define( 'MM_WELL_KNOWN_MIME_INFO', <<mMimeToExt[$mime]; } - // Resolve the mime type to the canonical type + // Resolve the MIME type to the canonical type if ( isset( $this->mMimeTypeAliases[$mime] ) ) { $mime = $this->mMimeTypeAliases[$mime]; if ( isset( $this->mMimeToExt[$mime] ) ) { @@ -405,7 +405,7 @@ class MimeMagic { } /** - * Returns a list of mime types for a given file extension as a space + * Returns a list of MIME types for a given file extension as a space * separated string or null if the extension was unrecognized. * * @param string $ext @@ -419,7 +419,7 @@ class MimeMagic { } /** - * Returns a single mime type for a given file extension or null if unknown. + * Returns a single MIME type for a given file extension or null if unknown. * This is always the first type from the list returned by getTypesForExtension($ext). * * @param string $ext @@ -439,9 +439,9 @@ class MimeMagic { } /** - * Tests if the extension matches the given mime type. Returns true if a - * match was found, null if the mime type is unknown, and false if the - * mime type is known but no matches where found. + * Tests if the extension matches the given MIME type. Returns true if a + * match was found, null if the MIME type is unknown, and false if the + * MIME type is known but no matches where found. * * @param string $extension * @param string $mime @@ -451,7 +451,7 @@ class MimeMagic { $ext = $this->getExtensionsForType( $mime ); if ( !$ext ) { - return null; // Unknown mime type + return null; // Unknown MIME type } $ext = explode( ' ', $ext ); @@ -461,7 +461,7 @@ class MimeMagic { } /** - * Returns true if the mime type is known to represent an image format + * Returns true if the MIME type is known to represent an image format * supported by the PHP GD library. * * @param string $mime @@ -490,7 +490,7 @@ class MimeMagic { * invalid uploads; if we can't identify the type we won't * be able to say if it's invalid. * - * @todo Be more accurate when using fancy mime detector plugins; + * @todo Be more accurate when using fancy MIME detector plugins; * right now this is the bare minimum getimagesize() list. * @param string $extension * @return bool @@ -515,15 +515,15 @@ class MimeMagic { } /** - * Improves a mime type using the file extension. Some file formats are very generic, - * so their mime type is not very meaningful. A more useful mime type can be derived + * Improves a MIME type using the file extension. Some file formats are very generic, + * so their MIME type is not very meaningful. A more useful MIME type can be derived * by looking at the file extension. Typically, this method would be called on the * result of guessMimeType(). * - * @param string $mime The mime type, typically guessed from a file's content. + * @param string $mime The MIME type, typically guessed from a file's content. * @param string $ext The file extension, as taken from the file name * - * @return string The mime type + * @return string The MIME type */ public function improveTypeFromExtension( $mime, $ext ) { if ( $mime === 'unknown/unknown' ) { @@ -538,7 +538,7 @@ class MimeMagic { } elseif ( $mime === 'application/x-opc+zip' ) { if ( $this->isMatchingExtension( $ext, $mime ) ) { // A known file extension for an OPC file, - // find the proper mime type for that file extension + // find the proper MIME type for that file extension $mime = $this->guessTypesForExtension( $ext ); } else { wfDebug( __METHOD__ . ": refusing to guess better type for $mime file, " . @@ -565,18 +565,18 @@ class MimeMagic { } /** - * Mime type detection. This uses detectMimeType to detect the mime type + * MIME type detection. This uses detectMimeType to detect the MIME type * of the file, but applies additional checks to determine some well known - * file formats that may be missed or misinterpreted by the default mime + * file formats that may be missed or misinterpreted by the default MIME * detection (namely XML based formats like XHTML or SVG, as well as ZIP * based formats like OPC/ODF files). * * @param string $file The file to check * @param string|bool $ext The file extension, or true (default) to extract it from the filename. * Set it to false to ignore the extension. DEPRECATED! Set to false, use - * improveTypeFromExtension($mime, $ext) later to improve mime type. + * improveTypeFromExtension($mime, $ext) later to improve MIME type. * - * @return string The mime type of $file + * @return string The MIME type of $file */ public function guessMimeType( $file, $ext = true ) { if ( $ext ) { // TODO: make $ext default to false. Or better, remove it. @@ -600,7 +600,7 @@ class MimeMagic { } /** - * Guess the mime type from the file contents. + * Guess the MIME type from the file contents. * * @param string $file * @param mixed $ext @@ -804,7 +804,7 @@ class MimeMagic { * @param string|null $tail The tail of the file * @param string|bool $ext The file extension, or true to extract it from the filename. * Set it to false (default) to ignore the extension. DEPRECATED! Set to false, - * use improveTypeFromExtension($mime, $ext) later to improve mime type. + * use improveTypeFromExtension($mime, $ext) later to improve MIME type. * * @return string */ @@ -847,7 +847,7 @@ class MimeMagic { # TODO: remove the block below, as soon as improveTypeFromExtension is used everywhere if ( $ext !== true && $ext !== false ) { /** This is the mode used by getPropsFromPath - * These mime's are stored in the database, where we don't really want + * These MIME's are stored in the database, where we don't really want * x-opc+zip, because we use it only for internal purposes */ if ( $this->isMatchingExtension( $ext, $mime ) ) { @@ -896,22 +896,22 @@ class MimeMagic { } /** - * Internal mime type detection. Detection is done using an external + * Internal MIME type detection. Detection is done using an external * program, if $wgMimeDetectorCommand is set. Otherwise, the fileinfo * extension and mime_content_type are tried (in this order), if they - * are available. If the detections fails and $ext is not false, the mime + * are available. If the detections fails and $ext is not false, the MIME * type is guessed from the file extension, using guessTypesForExtension. * - * If the mime type is still unknown, getimagesize is used to detect the - * mime type if the file is an image. If no mime type can be determined, + * If the MIME type is still unknown, getimagesize is used to detect the + * MIME type if the file is an image. If no MIME type can be determined, * this function returns 'unknown/unknown'. * * @param string $file The file to check * @param string|bool $ext The file extension, or true (default) to extract it from the filename. * Set it to false to ignore the extension. DEPRECATED! Set to false, use - * improveTypeFromExtension($mime, $ext) later to improve mime type. + * improveTypeFromExtension($mime, $ext) later to improve MIME type. * - * @return string The mime type of $file + * @return string The MIME type of $file */ private function detectMimeType( $file, $ext = true ) { global $wgMimeDetectorCommand; @@ -938,7 +938,7 @@ class MimeMagic { # If you may need to load the fileinfo extension at runtime, set # $wgLoadFileinfoExtension in LocalSettings.php - $mime_magic_resource = finfo_open( FILEINFO_MIME ); /* return mime type ala mimetype extension */ + $mime_magic_resource = finfo_open( FILEINFO_MIME ); /* return MIME type ala mimetype extension */ if ( $mime_magic_resource ) { $m = finfo_file( $mime_magic_resource, $file ); @@ -1003,18 +1003,18 @@ class MimeMagic { } /** - * Determine the media type code for a file, using its mime type, name and + * Determine the media type code for a file, using its MIME type, name and * possibly its contents. * - * This function relies on the findMediaType(), mapping extensions and mime + * This function relies on the findMediaType(), mapping extensions and MIME * types to media types. * * @todo analyse file if need be * @todo look at multiple extension, separately and together. * * @param string $path Full path to the image file, in case we have to look at the contents - * (if null, only the mime type is used to determine the media type code). - * @param string $mime Mime type. If null it will be guessed using guessMimeType. + * (if null, only the MIME type is used to determine the media type code). + * @param string $mime MIME type. If null it will be guessed using guessMimeType. * * @return string A value to be used with the MEDIATYPE_xxx constants. */ @@ -1023,7 +1023,7 @@ class MimeMagic { return MEDIATYPE_UNKNOWN; } - // If mime type is unknown, guess it + // If MIME type is unknown, guess it if ( !$mime ) { $mime = $this->guessMimeType( $path, false ); } @@ -1056,7 +1056,7 @@ class MimeMagic { } } - // Check for entry for full mime type + // Check for entry for full MIME type if ( $mime ) { $type = $this->findMediaType( $mime ); if ( $type !== MEDIATYPE_UNKNOWN ) { @@ -1076,7 +1076,7 @@ class MimeMagic { } } - // Check major mime type + // Check major MIME type if ( $mime ) { $i = strpos( $mime, '/' ); if ( $i !== false ) { @@ -1096,9 +1096,9 @@ class MimeMagic { } /** - * Returns a media code matching the given mime type or file extension. + * Returns a media code matching the given MIME type or file extension. * File extensions are represented by a string starting with a dot (.) to - * distinguish them from mime types. + * distinguish them from MIME types. * * This function relies on the mapping defined by $this->mMediaTypes * @access private @@ -1107,7 +1107,7 @@ class MimeMagic { */ function findMediaType( $extMime ) { if ( strpos( $extMime, '.' ) === 0 ) { - // If it's an extension, look up the mime types + // If it's an extension, look up the MIME types $m = $this->getTypesForExtension( substr( $extMime, 1 ) ); if ( !$m ) { return MEDIATYPE_UNKNOWN; @@ -1115,7 +1115,7 @@ class MimeMagic { $m = explode( ' ', $m ); } else { - // Normalize mime type + // Normalize MIME type if ( isset( $this->mMimeTypeAliases[$extMime] ) ) { $extMime = $this->mMimeTypeAliases[$extMime]; } diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 5d20005fac..3a0ed46642 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -52,7 +52,7 @@ abstract class ApiFormatBase extends ApiBase { } /** - * Overriding class returns the mime type that should be sent to the client. + * Overriding class returns the MIME type that should be sent to the client. * This method is not called if getIsHtml() returns true. * @return string */ diff --git a/includes/filebackend/FSFile.php b/includes/filebackend/FSFile.php index 47bacb5304..1659c62a34 100644 --- a/includes/filebackend/FSFile.php +++ b/includes/filebackend/FSFile.php @@ -118,9 +118,9 @@ class FSFile { $ext = self::extensionFromPath( $this->path ); } - # mime type according to file contents + # MIME type according to file contents $info['file-mime'] = $this->getMimeType(); - # logical mime type + # logical MIME type $info['mime'] = $magic->improveTypeFromExtension( $info['file-mime'], $ext ); list( $info['major_mime'], $info['minor_mime'] ) = File::splitMime( $info['mime'] ); diff --git a/includes/filebackend/README b/includes/filebackend/README index 569f337655..c06f6fc734 100644 --- a/includes/filebackend/README +++ b/includes/filebackend/README @@ -51,7 +51,7 @@ On files: * read a file into a string or several files into a map of path names to strings * download a file or set of files to a temporary file (on a mounted file system) * get the SHA1 hash of a file -* get various properties of a file (stat information, content time, mime information, ...) +* get various properties of a file (stat information, content time, MIME information, ...) On directories: * get a list of files directly under a directory diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index 735bf8a555..a71acdeba0 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -383,7 +383,7 @@ class ArchivedFile { } /** - * Returns the mime type of the file. + * Returns the MIME type of the file. * @return string */ public function getMimeType() { diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index c6da1f18b4..a61002aeac 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -679,7 +679,7 @@ abstract class File { } /** - * Returns the mime type of the file. + * Returns the MIME type of the file. * Overridden by LocalFile, UnregisteredLocalFile * STUB * diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 1eff1dfec4..3ba47ff8e9 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -91,10 +91,10 @@ class LocalFile extends File { /** @var int Result of the query for the file's history (nextHistoryLine) */ private $historyRes; - /** @var string Major mime type */ + /** @var string Major MIME type */ private $major_mime; - /** @var string Minor mime type */ + /** @var string Minor MIME type */ private $minor_mime; /** @var string Upload timestamp */ @@ -784,7 +784,7 @@ class LocalFile extends File { } /** - * Returns the mime type of the file. + * Returns the MIME type of the file. * @return string */ function getMimeType() { diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 4885ae6388..4e2ca836d8 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -44,7 +44,7 @@ class CSSMin { /* Protected Static Members */ - /** @var array List of common image files extensions and mime-types */ + /** @var array List of common image files extensions and MIME-types */ protected static $mimeTypes = array( 'gif' => 'image/gif', 'jpe' => 'image/jpeg', @@ -135,7 +135,7 @@ class CSSMin { */ public static function getMimeType( $file ) { $realpath = realpath( $file ); - // Try a couple of different ways to get the mime-type of a file, in order of + // Try a couple of different ways to get the MIME-type of a file, in order of // preference if ( $realpath @@ -143,14 +143,14 @@ class CSSMin { && function_exists( 'finfo_open' ) && defined( 'FILEINFO_MIME_TYPE' ) ) { - // As of PHP 5.3, this is how you get the mime-type of a file; it uses the Fileinfo + // As of PHP 5.3, this is how you get the MIME-type of a file; it uses the Fileinfo // PECL extension return finfo_file( finfo_open( FILEINFO_MIME_TYPE ), $realpath ); } elseif ( function_exists( 'mime_content_type' ) ) { - // Before this was deprecated in PHP 5.3, this was how you got the mime-type of a file + // Before this was deprecated in PHP 5.3, this was how you got the MIME-type of a file return mime_content_type( $file ); } else { - // Worst-case scenario has happened, use the file extension to infer the mime-type + // Worst-case scenario has happened, use the file extension to infer the MIME-type $ext = strtolower( pathinfo( $file, PATHINFO_EXTENSION ) ); if ( isset( self::$mimeTypes[$ext] ) ) { return self::$mimeTypes[$ext]; diff --git a/includes/libs/IEContentAnalyzer.php b/includes/libs/IEContentAnalyzer.php index a80f6d91a0..c31a35278a 100644 --- a/includes/libs/IEContentAnalyzer.php +++ b/includes/libs/IEContentAnalyzer.php @@ -333,7 +333,7 @@ class IEContentAnalyzer { * @param string $chunk the first 256 bytes of the file * @param string $proposed the MIME type proposed by the server * - * @return Array: map of IE version to detected mime type + * @return Array: map of IE version to detected MIME type */ public function getRealMimesFromData( $fileName, $chunk, $proposed ) { $types = $this->getMimesFromData( $fileName, $chunk, $proposed ); @@ -371,7 +371,7 @@ class IEContentAnalyzer { * @param string $chunk the first 256 bytes of the file * @param string $proposed the MIME type proposed by the server * - * @return Array: map of IE version to detected mime type + * @return Array: map of IE version to detected MIME type */ public function getMimesFromData( $fileName, $chunk, $proposed ) { $types = array(); diff --git a/includes/libs/lessc.inc.php b/includes/libs/lessc.inc.php index 37723d5b58..61ed771afa 100644 --- a/includes/libs/lessc.inc.php +++ b/includes/libs/lessc.inc.php @@ -1036,7 +1036,7 @@ class lessc { } } - if(!is_null($mime)) // fallback if the mime type is still unknown + if(!is_null($mime)) // fallback if the MIME type is still unknown $url = sprintf('data:%s;base64,%s', $mime, base64_encode(file_get_contents($fullpath))); } } diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index e8f83608b0..969bb7218d 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -313,15 +313,15 @@ abstract class MediaHandler { function getThumbType( $ext, $mime, $params = null ) { $magic = MimeMagic::singleton(); if ( !$ext || $magic->isMatchingExtension( $ext, $mime ) === false ) { - // The extension is not valid for this mime type and we do - // recognize the mime type + // The extension is not valid for this MIME type and we do + // recognize the MIME type $extensions = $magic->getExtensionsForType( $mime ); if ( $extensions ) { return array( strtok( $extensions, ' ' ), $mime ); } } - // The extension is correct (true) or the mime type is unknown to + // The extension is correct (true) or the MIME type is unknown to // MediaWiki (null) return array( $ext, $mime ); } diff --git a/includes/media/XMPInfo.php b/includes/media/XMPInfo.php index 3700556bfe..7e47ec14e3 100644 --- a/includes/media/XMPInfo.php +++ b/includes/media/XMPInfo.php @@ -726,7 +726,7 @@ class XMPInfo { 'mode' => XMPReader::MODE_SEQ, 'validate' => 'validateDate', ), - /* Do not extract dc:format, as we've got better ways to determine mimetype */ + /* Do not extract dc:format, as we've got better ways to determine MIME type */ 'identifier' => array( 'map_group' => 'deprecated', 'map_name' => 'Identifier', diff --git a/includes/mime.info b/includes/mime.info index 7a4de3b9ad..b86d7d7ab7 100644 --- a/includes/mime.info +++ b/includes/mime.info @@ -1,5 +1,5 @@ -# Mime type info file. -# the first mime type in each line is the "main" mime type, +# MIME type info file. +# the first MIME type in each line is the "main" MIME type, # the others are aliases for this type # the media type is given in upper case and square brackets, # like [BITMAP], and must indicate a media type as defined by diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index b5b41766b6..ddb435d95b 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -197,8 +197,8 @@ class SpecialUploadStash extends UnlistedSpecialPage { throw new UploadStashFileNotFoundException( "no local path for scaled item" ); } - // now we should construct a File, so we can get mime and other such info in a standard way - // n.b. mimetype may be different from original (ogx original -> jpeg thumb) + // now we should construct a File, so we can get MIME and other such info in a standard way + // n.b. MIME type may be different from original (ogx original -> jpeg thumb) $thumbFile = new UnregisteredLocalFile( false, $this->stash->repo, $thumbnailImage->getStoragePath(), false ); if ( !$thumbFile ) { @@ -292,7 +292,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { * Output HTTP response of raw content * Side effect: writes HTTP response to STDOUT. * @param string $content Content - * @param string $contentType Mime type + * @param string $contentType MIME type * @throws SpecialUploadStashTooLargeException * @return bool */ @@ -310,7 +310,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { /** * Output headers for streaming * @todo Unsure about encoding as binary; if we received from HTTP perhaps - * we should use that encoding, concatted with semicolon to mimeType as it + * we should use that encoding, concatenated with semicolon to `$contentType` as it * usually is. * Side effect: preps PHP to write headers to STDOUT. * @param string $contentType String suitable for content-type header diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 6a6b358aae..4d74a2df70 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -377,11 +377,12 @@ abstract class UploadBase { } /** - * Verify the mime type. + * Verify the MIME type. * - * @note Only checks that it is not an evil mime. The "does it have - * correct extension given its mime type?" check is in verifyFile. - * @param string $mime Representing the mime + * @note Only checks that it is not an evil MIME. The "does it have + * correct extension given its MIME type?" check is in verifyFile. + * in `verifyFile()` that MIME type and file extension correlate. + * @param string $mime Representing the MIME * @return mixed True if the file is verified, an array otherwise */ protected function verifyMimeType( $mime ) { @@ -396,7 +397,7 @@ abstract class UploadBase { return array( 'filetype-badmime', $mime ); } - # Check IE type + # Check what Internet Explorer would detect $fp = fopen( $this->mTempPath, 'rb' ); $chunk = fread( $fp, 256 ); fclose( $fp ); @@ -487,7 +488,7 @@ abstract class UploadBase { $this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension ); - # check mime type, if desired + # check MIME type, if desired $mime = $this->mFileProps['file-mime']; $status = $this->verifyMimeType( $mime ); if ( $status !== true ) { @@ -995,9 +996,9 @@ abstract class UploadBase { } /** - * Checks if the mime type of the uploaded file matches the file extension. + * Checks if the MIME type of the uploaded file matches the file extension. * - * @param string $mime The mime type of the uploaded file + * @param string $mime The MIME type of the uploaded file * @param string $extension The filename extension that the file is to be served with * @return bool */ @@ -1050,7 +1051,7 @@ abstract class UploadBase { * positives in some situations. * * @param string $file Pathname to the temporary upload file - * @param string $mime The mime type of the file + * @param string $mime The MIME type of the file * @param string $extension The extension of the file * @return bool True if the file contains something looking like embedded scripts */ diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 23a7a3a8fe..7d80b4489e 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -443,7 +443,7 @@ class UploadStash { } /** - * Find or guess extension -- ensuring that our extension matches our mime type. + * Find or guess extension -- ensuring that our extension matches our MIME type. * Since these files are constructed from php tempnames they may not start off * with an extension. * XXX this is somewhat redundant with the checks that ApiUpload.php does with incoming @@ -460,7 +460,7 @@ class UploadStash { if ( $n !== false ) { $extension = $n ? substr( $path, $n + 1 ) : ''; } else { - // If not, assume that it should be related to the mime type of the original file. + // If not, assume that it should be related to the MIME type of the original file. $magic = MimeMagic::singleton(); $mimeType = $magic->guessMimeType( $path ); $extensions = explode( ' ', MimeMagic::singleton()->getExtensionsForType( $mimeType ) ); diff --git a/maintenance/archives/patch-mimesearch-indexes.sql b/maintenance/archives/patch-mimesearch-indexes.sql index bd348c46c2..8d9426ea77 100644 --- a/maintenance/archives/patch-mimesearch-indexes.sql +++ b/maintenance/archives/patch-mimesearch-indexes.sql @@ -1,4 +1,4 @@ --- Add indexes to the mime types in image for use on Special:MIMEsearch, +-- Add indexes to the MIME types in image for use on Special:MIMEsearch, -- changes a query like -- -- SELECT img_name FROM image WHERE img_major_mime = "image" AND img_minor_mime = "svg"; diff --git a/maintenance/dev/includes/router.php b/maintenance/dev/includes/router.php index 246d6fc649..0a65e31e9e 100644 --- a/maintenance/dev/includes/router.php +++ b/maintenance/dev/includes/router.php @@ -80,7 +80,7 @@ if ( !$mime ) { } } if ( $mime ) { - # Use custom handling to serve files with a known mime type + # Use custom handling to serve files with a known MIME type # This way we can serve things like .svg files that the built-in # PHP webserver doesn't understand. # ;) Nicely enough we just happen to bundle a mime.types file diff --git a/maintenance/refreshImageMetadata.php b/maintenance/refreshImageMetadata.php index 8cb23fd528..831118ca7b 100644 --- a/maintenance/refreshImageMetadata.php +++ b/maintenance/refreshImageMetadata.php @@ -70,7 +70,7 @@ class RefreshImageMetadata extends Maintenance { $this->addOption( 'mime', - '(Inefficient!) Only refresh files with this mime type. Can accept wild-card image/*', + '(Inefficient!) Only refresh files with this MIME type. Can accept wild-card image/*', false, true ); diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 380e4e6eb9..d50fe48f94 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -1750,7 +1750,7 @@ * * @param {string|Array} modules Either the name of a module, array of modules, * or a URL of an external script or style - * @param {string} [type='text/javascript'] mime-type to use if calling with a URL of an + * @param {string} [type='text/javascript'] MIME type to use if calling with a URL of an * external script or style; acceptable values are "text/css" and * "text/javascript"; if no type is provided, text/javascript is assumed. * @param {boolean} [async] Whether to load modules asynchronously. diff --git a/tests/phpunit/includes/MimeMagicTest.php b/tests/phpunit/includes/MimeMagicTest.php index 2937790160..19746a99eb 100644 --- a/tests/phpunit/includes/MimeMagicTest.php +++ b/tests/phpunit/includes/MimeMagicTest.php @@ -12,8 +12,8 @@ class MimeMagicTest extends MediaWikiTestCase { /** * @dataProvider providerImproveTypeFromExtension * @param $ext String File extension (no leading dot) - * @param $oldMime String Initially detected mime - * @param $expectedMime String Mime type after taking extension into account + * @param $oldMime String Initially detected MIME + * @param $expectedMime String MIME type after taking extension into account */ function testImproveTypeFromExtension( $ext, $oldMime, $expectedMime ) { $actualMime = $this->mimeMagic->improveTypeFromExtension( $oldMime, $ext ); diff --git a/tests/phpunit/includes/api/ApiTestCaseUpload.php b/tests/phpunit/includes/api/ApiTestCaseUpload.php index 40407dc6f1..837becc641 100644 --- a/tests/phpunit/includes/api/ApiTestCaseUpload.php +++ b/tests/phpunit/includes/api/ApiTestCaseUpload.php @@ -98,7 +98,7 @@ abstract class ApiTestCaseUpload extends ApiTestCase { * * @param string $fieldName name this would have in the upload form * @param string $fileName name to title this - * @param string $type mime type + * @param string $type MIME type * @param string $filePath path where to find file contents * * @throws Exception diff --git a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php index e7bb35c126..aca77be62e 100644 --- a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php +++ b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php @@ -17,8 +17,8 @@ class SpecialMIMESearchTest extends MediaWikiTestCase { /** * @dataProvider providerMimeFiltering * @param $par String subpage for special page - * @param $major String Major mime type we expect to look for - * @param $minor String Minor mime type we expect to look for + * @param $major String Major MIME type we expect to look for + * @param $minor String Minor MIME type we expect to look for */ function testMimeFiltering( $par, $major, $minor ) { $this->page->run( $par ); diff --git a/thumb.php b/thumb.php index d53c10c93e..efaa65bc62 100644 --- a/thumb.php +++ b/thumb.php @@ -24,7 +24,7 @@ define( 'MW_NO_OUTPUT_COMPRESSION', 1 ); require __DIR__ . '/includes/WebStart.php'; -// Don't use fancy mime detection, just check the file extension for jpg/gif/png +// Don't use fancy MIME detection, just check the file extension for jpg/gif/png $wgTrivialMimeDetection = true; if ( defined( 'THUMB_HANDLER' ) ) { @@ -573,7 +573,7 @@ function wfExtractThumbParams( $file, $params ) { return $params; // valid thumbnail URL (via extension or config) } - // FIXME: Files in the temp zone don't set a mime type, which means + // FIXME: Files in the temp zone don't set a MIME type, which means // they don't have a handler. Which means we can't parse the param // string. However, not a big issue as what good is a param string // if you have no handler to make use of the param string and