Download the PHP package xdg/mime without Composer
On this page you can find all versions of the php package xdg/mime. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mime
xdg/mime
This package is a pure PHP implementation of the XDG Shared MIME-Info Database specification.
It is primarily aimed at MIME-type detection.
Installation
Usage
- Basic usage instructions
- Customizing the MIME database
Implementation notes
Most XDG Shared MIME-Info implementations read their data from binary cache files
generated by the update-mime-database
program.
This turns out to be impractical in the context of PHP for several reasons:
- First, PHP doesn't have native
mmap
functionality, so reading these files at runtime can produce a lot of I/O. - Second, parsing these files at runtime has a non-negligible overhead.
- And last, PHP runs on server environments where the
update-mime-database
program is often not available (and possibly even not installable).
Therefore, this library takes another approach: parsing the MIME database in its original XML format, and compiling it to executable PHP code. This yields several advantages:
- Since most PHP applications have a build / deploy step, the overhead of parsing the database at runtime is eliminated entirely.
- Generating PHP code allows leveraging the PHP opcode cache, which makes loading the database very fast.
- Since performance is less paramount at build time, the library does additional work to optimize the generated PHP code for optimal runtime performance.
For convenience, this package ships with a pre-compiled database, built from the latest shared-mime-info database.
All versions of mime with dependencies
ext-dom Version *
ext-libxml Version *
ext-xml Version *
symfony/filesystem Version ^5.4||^6.1
xdg/base-directory Version ^1.0
ju1ius/luigi Version ^1.0