PHPackages                             ab/lib-mime - 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. ab/lib-mime

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

ab/lib-mime
===========

An extremely lightweight mostly static mime, content-type and file extension library.

v0.1.0(6y ago)013MITPHPCI failing

Since Oct 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/abcarroll/lib-mime)[ Packagist](https://packagist.org/packages/ab/lib-mime)[ RSS](/packages/ab-lib-mime/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

lib-mime
========

[](#lib-mime)

An extremely lightweight mostly static mime, content-type and file extension library

Install
-------

[](#install)

```
composer require ab/lib-mime

```

Use
---

[](#use)

An example router script to pass through resources:

```
use ab\Mime\MimeTypeArray;

(function () {
        $tryPath = $_SERVER['REQUEST_URI'];
        $filename = basename($tryPath);
        [$fileext,] = explode('.', strrev($filename), 2);
        $fileext = strrev($fileext);

	      // ....

        $type = MimeTypeArray::getContentType($fileext);
        if ($type !== null) {
            header("Content-Type: $type", true);
        } else {
            header("Content-Type: application/octet-stream", true);
        }

        // ...
}());
```

License
-------

[](#license)

Released under the "Unlicense", which is public domain. Read more at .

[Uses the "mime.types" file Provided By The Apache Project](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2407d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13ac690f7dcc7b9e3f0bea11ac63032685475b78c7dcfeeaa69b6e64f1c0e5a7?d=identicon)[abcarroll](/maintainers/abcarroll)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ab-lib-mime/health.svg)

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

###  Alternatives

[oomphinc/drupal-scaffold

A Drupal scaffold project

192.6k](/packages/oomphinc-drupal-scaffold)

PHPackages © 2026

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