php-extended/php-apache-media-types-bundle

This package is abandoned and no longer maintained. The author suggests using the php-extended/php-mime-type-object package instead.

A library to get default known extensions from media types


README

A library to get default known extensions from media types.

This library uses the https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types source file to update its contents. This library is updated once a week, every sunday.

Last Updated Date : 2020-09-13

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"php-extended/php-apache-media-types-bundle": "^2",
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Basic Usage

You may use this library the following way:


use PhpExtended\MediaTypes\ApacheMediaTypesList;

$list = new ApacheMediaTypesList();

foreach($list => $mimeType)
{
	/* $mimeType \PhpExtended\MediaTypes\ApacheMediaTypes;
	// do what you want with the mime type
}

License

MIT (See license file).