Download the PHP package fileeye/mimemap without Composer

On this page you can find all versions of the php package fileeye/mimemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mimemap

MimeMap

PHP Version Require Tests PHPStan level Psalm coverage Psalm level codecov Latest Stable Version Total Downloads License

A PHP library to handle MIME Content-Type fields and their related file extensions.

Features

Credits

MimeMap is a fork of PEAR's MIME_Type package. See all the original contributors.

Note that in comparison with PEAR's MIME_Type, this library has a different scope, mainly focused on finding the mapping between each MIME type and its generally accepted file extensions. Features to detect the MIME type of a file have been removed. The symfony/http-foundation library and its MimeTypeGuesser API are the suggested components to cover that use case.

Alternative packages

MimeMap's main difference from similar packages is that it provides functionalities to use multiple type-to-extension maps and to change the mapping either at runtime or statically in PHP classes. See wgenial/php-mimetyper for a nice list of alternative PHP libraries for MIME type handling.

Installation

Usage

Basic

The package comes with a default map that describes MIME types and the file extensions normally associated to each MIME type. The map also stores information about MIME type aliases, (alternative media/subtype combinations that describe the same MIME type), and the descriptions of most MIME types and of the acronyms used.

For example: the MIME type 'application/pdf'

The API the package implements is pretty straightforward:

  1. You have a MIME type, and want to get the file extensions normally associated to it:

  2. Viceversa, you have a file extensions, and want to get the MIME type normally associated to it:

  3. You have a raw MIME Content-Type string and want to add a parameter:

  4. You have a MIME Content-Type string and want to add the type's description as a comment:

Specify alternative MIME type mapping

You can also alter the default map at runtime, either by adding/removing mappings, or indicating to MimeMap to use a totally different map. The alternative map must be stored in a PHP class that extends from \FileEye\MimeMap\Map\AbstractMap.

  1. You want to add an additional MIME type to extension mapping to the default class:

  2. You want to set an alternative map class as default:

  3. You can also use the alternative map just for a single Type or Extension object:

Development

Updating the extension mapping code

The default extension-to-type mapping class can be updated from the sources' code repositories, using the fileeye-mimemap utility:

By default, the utility fetches a mapping source available from the Apache's documentation website, merges it with another mapping source from the freedesktop.org project, then integrates the result with any overrides specified in the resources/default_map_build.yml file, and finally updates the PHP file where the \FileEye\MimeMap\Map\DefaultMap class is stored.

The --script and --class options allow specifying a different update logic and a different class file to update. Type

to get more information.


All versions of mimemap with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fileeye/mimemap contains the following files

Loading the files please wait ....