php-extended/php-mime-type-object

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

7.0.13 2024-06-16 02:20 UTC

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 : 2024-06-16

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar php-extended/php-mime-type-object ^7

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).