PHPackages                             pear/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. pear/mime\_type

AbandonedArchivedLibrary

pear/mime\_type
===============

Detect the MIME Type of a file

v1.4.1(10y ago)546.7k↓30.8%11LGPLPHP

Since Feb 20Pushed 8y ago2 watchersCompare

[ Source](https://github.com/pear/MIME_Type)[ Packagist](https://packagist.org/packages/pear/mime_type)[ Docs](http://pear.php.net/package/MIME_Type)[ RSS](/packages/pear-mime-type/feed)WikiDiscussions master Synced 1mo ago

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

MIME\_Type
==========

[](#mime_type)

PHP library to detect, parse and work with MIME types.

Features:

- Parse MIME types
- Supports full RFC 2045 specification
- Many utility functions for working with and determining info about types
- Most functions can be called statically
- Autodetect a file's mime-type, either with `fileinfo` extension, `mime_magic` extension, the 'file' command or an in-built file extension mapping list

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

[](#installation)

### PEAR

[](#pear)

```
$ pear install MIME_Type
```

### Composer

[](#composer)

```
$ composer require pear/mime_type
```

Usage
-----

[](#usage)

See the examples in the `docs/examples/` directory and the [official documentation](http://pear.php.net/package/MIME_Type/docs).

### Detecting a file's MIME type

[](#detecting-a-files-mime-type)

```

```

Links
-----

[](#links)

Homepage[http://pear.php.net/package/MIME\_Type](http://pear.php.net/package/MIME_Type)Bug tracker[http://pear.php.net/bugs/search.php?cmd=display&amp;package\_name\[\]=MIME\_Type](http://pear.php.net/bugs/search.php?cmd=display&package_name[]=MIME_Type)Documentation[http://pear.php.net/package/MIME\_Type/docs](http://pear.php.net/package/MIME_Type/docs)Unit test status[https://travis-ci.org/pear/MIME\_Type](https://travis-ci.org/pear/MIME_Type)

[![https://travis-ci.org/pear/MIME_Type.svg?branch=master](https://camo.githubusercontent.com/78c3ebb3c5104e5c6d3ba515082fc11c8a1a39fbb3a0720bf3c7cab5be11254a/68747470733a2f2f7472617669732d63692e6f72672f706561722f4d494d455f547970652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pear/MIME_Type)Development
-----------

[](#development)

### Updating extension mapping

[](#updating-extension-mapping)

The built-in extension-to-type mapping list can be updated from apache's source code repository:

```
$ ./scripts/update-mimelist.php
...
785 new, 28 updated, 168 same, 5 own, 986 total
Code updated
```

The file `MIME/Type/Extension.php` will be changed now.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 89.1% 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 ~85 days

Total

4

Last Release

3848d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1323714f58f9144af310e5e4217e61b96ad7c42bc5c93a1f2d97deca95f6f4f8?d=identicon)[ashnazg](/maintainers/ashnazg)

![](https://www.gravatar.com/avatar/a1a2e6fe03f91204de2117430a748a12db2957eb113d4a50fc86d68d3c851e11?d=identicon)[cweiske](/maintainers/cweiske)

---

Top Contributors

[![cweiske](https://avatars.githubusercontent.com/u/59036?v=4)](https://github.com/cweiske "cweiske (57 commits)")[![CloCkWeRX](https://avatars.githubusercontent.com/u/365751?v=4)](https://github.com/CloCkWeRX "CloCkWeRX (4 commits)")[![till](https://avatars.githubusercontent.com/u/27003?v=4)](https://github.com/till "till (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[pear/archive_tar

Tar file management class with compression support (gzip, bzip2, lzma2)

7661.0M73](/packages/pear-archive-tar)[pear/mail_mime

Mail\_Mime provides classes to create MIME messages

497.4M28](/packages/pear-mail-mime)[pear/mail

Class that provides multiple interfaces for sending emails.

414.7M18](/packages/pear-mail)[pear/spreadsheet_excel_writer

Allows writing of Excel spreadsheets without the need for COM objects. Supports formulas, images (BMP) and all kinds of formatting for text and cells.

441.3M3](/packages/pear-spreadsheet-excel-writer)[pear/net_smtp

An implementation of the SMTP protocol

263.0M16](/packages/pear-net-smtp)

PHPackages © 2026

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