PHPackages                             skyzyx/mimetypes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. skyzyx/mimetypes

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

skyzyx/mimetypes
================

Creates a JSON document containing a thorough list of file extensions =&gt; mime types as provided by the Apache httpd project.

1.1.1(13y ago)17202.4k↓11.6%5[1 PRs](https://github.com/skyzyx/mimetypes/pulls)5MITPHPPHP &gt;=5.3

Since Feb 6Pushed 1y ago2 watchersCompare

[ Source](https://github.com/skyzyx/mimetypes)[ Packagist](https://packagist.org/packages/skyzyx/mimetypes)[ Docs](http://github.com/skyzyx/mimetypes)[ RSS](/packages/skyzyx-mimetypes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (5)

Mimetypes
=========

[](#mimetypes)

Creates a JSON document containing a thorough list of file extensions =&gt; mime types as provided by the [Apache httpd project](http://httpd.apache.org).

How to use
----------

[](#how-to-use)

### Step 1

[](#step-1)

Download the latest copy of the Apache `mime-types` file into the same directory as the `generate` script.

```
cd mimetypes &&
wget --no-check-certificate https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/docs/conf/mime.types
```

### Step 1.5 (optional)

[](#step-15-optional)

Update the provided `customize.json` document with any additional mimetypes to define, or any that you would like to override.

### Step 2

[](#step-2)

Run the `generate` script.

```
./generate
```

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.

Installation
------------

[](#installation)

### Install source from GitHub

[](#install-source-from-github)

To install the source code:

```
git clone git://github.com/skyzyx/mimetypes.git
```

And use it in your scripts:

```
$mimetypes = json_decode('/path/to/mimetypes/mimetypes.json', true);
$type = $mimetypes['html'];
#=> text/html

// ...or...

use Skyzyx\Components\Mimetypes\Mimetypes;
$type = Mimetypes::getInstance()->fromExtension('html');
#=> text/html
```

### Install with Composer

[](#install-with-composer)

If you're using [Composer](http://getcomposer.org) to manage dependencies, you can add the mimetypes with it.

```
{
    "require": {
        "skyzyx/mimetypes": ">=1.0"
    }
}
```

See Also...
-----------

[](#see-also)

For a similar-yet-different approach (including reverse-lookups from `mimetypes => extensions`), check out [dflydev-apache-mime-types](https://github.com/dflydev/dflydev-apache-mime-types).

License &amp; Copyright
-----------------------

[](#license--copyright)

Copyright (c) 2010-2013 [Ryan Parman](http://ryanparman.com). Licensed for use under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.php). See the [list of contributors](https://github.com/skyzyx/mimetypes/contributors) for more author information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~139 days

Total

4

Last Release

4796d ago

PHP version history (2 changes)1.0PHP &gt;=5.2

1.1PHP &gt;=5.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39447?v=4)[Ryan Parman](/maintainers/skyzyx)[@skyzyx](https://github.com/skyzyx)

---

Top Contributors

[![skyzyx](https://avatars.githubusercontent.com/u/39447?v=4)](https://github.com/skyzyx "skyzyx (26 commits)")[![rawebone](https://avatars.githubusercontent.com/u/725571?v=4)](https://github.com/rawebone "rawebone (1 commits)")[![simensen](https://avatars.githubusercontent.com/u/191200?v=4)](https://github.com/simensen "simensen (1 commits)")

---

Tags

mimemapmimetypedictionary

### Embed Badge

![Health badge](/badges/skyzyx-mimetypes/health.svg)

```
[![Health](https://phpackages.com/badges/skyzyx-mimetypes/health.svg)](https://phpackages.com/packages/skyzyx-mimetypes)
```

###  Alternatives

[symfony/mime

Allows manipulating MIME messages

2.8k668.8M911](/packages/symfony-mime)[zbateson/mail-mime-parser

MIME email message parser

53949.2M79](/packages/zbateson-mail-mime-parser)[php-mime-mail-parser/php-mime-mail-parser

A fully tested email parser for PHP 8.0+ (mailparse extension wrapper).

9979.6M27](/packages/php-mime-mail-parser-php-mime-mail-parser)[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M246](/packages/nette-mail)[zbateson/stream-decorators

PHP psr7 stream decorators for mime message part streams

4748.6M6](/packages/zbateson-stream-decorators)[dflydev/apache-mime-types

Apache MIME Types

701.9M35](/packages/dflydev-apache-mime-types)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
