MediaWiki  REL1_22
MimeMagic.php File Reference

Module defining helper functions for detecting and dealing with mime types. More...

Go to the source code of this file.

Classes

class  MimeMagic
 Implements functions related to mime types such as detection and mapping to file extension. More...

Enumerations

enum  MM_WELL_KNOWN_MIME_INFO
 Defines a set of well known mime info entries This is used as a fallback to mime.info files. More...
enum  MM_WELL_KNOWN_MIME_TYPES
 Defines a set of well known mime types This is used as a fallback to mime.types files. More...

Detailed Description

Module defining helper functions for detecting and dealing with mime types.

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

Definition in file MimeMagic.php.


Enumeration Type Documentation

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 the file mime.info in the includes directory.

Definition at line 94 of file MimeMagic.php.

Defines a set of well known mime types This is used as a fallback to mime.types files.

An extensive list of well known mime types is provided by the file mime.types in the includes directory.

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 appending MM_WELL_KNOWN_MIME_TYPES behind $wgMimeTypeFile, but who knows what will break? In practice this probably isn't a problem anyway -- Bryan)

Definition at line 42 of file MimeMagic.php.