Download the PHP package karelwintersky/arris.toolkit.mimetypes without Composer
On this page you can find all versions of the php package karelwintersky/arris.toolkit.mimetypes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download karelwintersky/arris.toolkit.mimetypes
More information about karelwintersky/arris.toolkit.mimetypes
Files in karelwintersky/arris.toolkit.mimetypes
Package arris.toolkit.mimetypes
Short Description Resolves Extension by MimeType and vice versa
License MIT
Homepage https://github.com/ArrisFramework/Arris.Toolkit.MimeTypes
Informations about the package arris.toolkit.mimetypes
What is it? %%generate_datetime%%
PHP package for converting file extensions to MIME types and vice versa.
Uses the MIME content type for a file as determined by using information from the magic.mime
file.
Mimetypes
Creates a JSON document containing a thorough list of file extensions => mime types as provided by the Apache httpd project.
How to update?
Step 1
Download the latest copy of the Apache mime-types
file into the same directory as the generate
script
or
Step 2 (optional)
Update the provided mime.types.custom
. This file is in the same format as mime.types
but the mappings in this file take precedence.
Update the provided customize.json
document with any additional mimetypes to define, or any that you would like to override.
Step 3
Run the generate
script:
In the end, a mimetypes.json
document will be generated. This JSON document can be easily parsed into a
map/dictionary/associative array by pretty much every programming language with little effort.
It also generates a backing PHP class if you want to use the data in PHP-land.
Step 4
Step 5
Update repository (commit, push, pull request)
Installation
Install with Composer
If you're using Composer to manage dependencies, you can add the mimetypes with it.
or
Usage
And use it in your scripts:
NB:
'fallback' function mime_content_type()
return all same data.
License & Copyright
Original idea: 2010-2013 Ryan Parman.
Refactored: 2023 Karel Wintersky
removed unnecessary Twig template engine and dflydev/apache-mime-types
(repository load/mapper)
Licensed for use under the terms of the MIT license.