PHPackages                             brianreeve/mime-type - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. brianreeve/mime-type

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

brianreeve/mime-type
====================

Improves mime\_type detection over fileinfo without dependencies on any system utility (such as the Linux file command).

22.3kPHP

Since Jan 31Pushed 11y ago2 watchersCompare

[ Source](https://github.com/brianreeve/MimeType)[ Packagist](https://packagist.org/packages/brianreeve/mime-type)[ RSS](/packages/brianreeve-mime-type/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#MimeType

Improves mime\_type detection over finfo without dependencies on any system utility (such as the Linux file command).

Uses a local cached copy of the mime types from Apache's repository:

\##Installation

\###Using Composer

Edit composer.json and add:

```
"brianreeve/mime-type": "dev-master"

```

\##Usage

```
use BrianReeve/MimeType/MimeType;

$mimeType = MimeType::detect($path);

```

The detect method first looks for a match by extension in the list from Apache, then tries finfo, lastly defaults to text/plain.

\##To Update to the Latest

To update the cache, run

```
php src/BrianReeve/MimeType/Utils/generate_mime_types_array.php

```

Updated mime types will be saved to

```
src/BrianReeve/MimeType/lib/mime_types.json

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/82f66d5440ef7169a90fa6e5f9a16893bb58b121d88b92ba2779bdd5da7e2673?d=identicon)[brianreeve](/maintainers/brianreeve)

---

Top Contributors

[![brianreeve](https://avatars.githubusercontent.com/u/8030260?v=4)](https://github.com/brianreeve "brianreeve (4 commits)")

### Embed Badge

![Health badge](/badges/brianreeve-mime-type/health.svg)

```
[![Health](https://phpackages.com/badges/brianreeve-mime-type/health.svg)](https://phpackages.com/packages/brianreeve-mime-type)
```

###  Alternatives

[loophp/collection

A (memory) friendly, easy, lazy and modular collection class.

745663.8k13](/packages/loophp-collection)[wolfcast/browser-detection

The Wolfcast BrowserDetection PHP class facilitates the identification of the user's environment such as Web browser, version, platform family, platform version or if it's a mobile device or not.

1391.0M7](/packages/wolfcast-browser-detection)[lisachenko/z-engine

Library that provides direct access to native PHP structures

45423.0k3](/packages/lisachenko-z-engine)[bretterer/iso_duration_converter

Easily convert ISO\_8601 Duration time format to seconds and convert seconds to ISO-8601 Duration

271.9M5](/packages/bretterer-iso-duration-converter)[frankmullenger/underconstruction

SilverStripe Under Construction Page Module

162.2k](/packages/frankmullenger-underconstruction)

PHPackages © 2026

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