php-extended/php-mime-type-object

An implementation of the php-extended/php-mime-type-interface library


README

An implementation of the php-extended/php-mime-type-interface library.

coverage build status

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 uses the https://www.iana.org/assignments/media-types/media-types.xhtml source file to update its contents.

This library is updated once a week, every sunday.

Last Updated Date : 2022-08-07

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-mime-type-object": "^3",
		...
	}

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

This library is to provide standard classes to be manipulated with a mime type provider.

To parse mime types, use the following :


use PhpExtended\MimeType\MimeTypeParser;

$parser = new MimeTypeParser();
$type = $parser->parse('text/html');
// $type is now a MimeTypeInterface with value "html", and 
// parent category as MimeCategoryInterface with value "text".

License

MIT (See license file).