PHPackages                             mvccore/ext-tool-mimetype-extension - 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. [Framework](/categories/framework)
4. /
5. mvccore/ext-tool-mimetype-extension

ActiveLibrary[Framework](/categories/framework)

mvccore/ext-tool-mimetype-extension
===================================

MvcCore - Extension - Tool - MimeType &amp; Extensions - extension to get file mimetype(s) strings array from file extension string or to get file extension(s) strings array from file mimetype string.

v5.3.0(1y ago)138512BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jan 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mvccore/ext-tool-mimetype-extension)[ Packagist](https://packagist.org/packages/mvccore/ext-tool-mimetype-extension)[ RSS](/packages/mvccore-ext-tool-mimetype-extension/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (3)Used By (2)

MvcCore - Extension - Tool - Mimetype &amp; Extension
=====================================================

[](#mvccore---extension---tool---mimetype--extension)

[![Latest Stable Version](https://camo.githubusercontent.com/6a0e9e7da98c52006afe617f10a93df0da2dce64b73eedf5b9b3fcee6bfb6039/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537461626c652d76352e332e302d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://github.com/mvccore/ext-tool-mimetype-extension/releases)[![License](https://camo.githubusercontent.com/53baed538c1c87a033a212f6f4acce684d36137f8622307643ab25e08118452e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://mvccore.github.io/docs/mvccore/5.0.0/LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/9e923690739211296a00adce5d359999dfa345f80fc1b2e2cfe72c49523ee334/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d352e342d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://camo.githubusercontent.com/9e923690739211296a00adce5d359999dfa345f80fc1b2e2cfe72c49523ee334/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d352e342d627269676874677265656e2e7376673f7374796c653d706c6173746963)

MvcCore extension to get:

- Mimetype(s) strings array from file extension string
- Extension(s) strings array from file mimetype string

This extension doesn't use PHP `mime_content_type()` function.
To recognize which mimetype has uploaded file by magic bytes does form control (`input:file`) validator itself using PHP `fionfo` extension.
This extension has only list of mimetypes and extensions to properly decide, which file extension could be finally stored on server HDD after magic bytes recognition.

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

[](#installation)

```
composer require mvccore/ext-tool-mimetype-extension
```

Mimetypes And Extensions Sources
--------------------------------

[](#mimetypes-and-extensions-sources)

Database of all mimetypes and extensions is loaded by Node.JS project [`jshttp/mime-db`](https://github.com/jshttp/mime-db) from 4 sources:

- [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml) ()
- [APACHE](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) ()
- [NGINX](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) ()
- custom definitions in `./custom-mimes.json`

Usage
-----

[](#usage)

```
use \MvcCore\Ext\Tools;

$mimeTypes = Tools\MimeTypesExtensions::GetMimeTypesByExtension('dmg');
// ['application/x-apple-diskimage', 'application/octet-stream']
var_dump($mimeTypes);

$mimeTypes = Tools\MimeTypesExtensions::GetMimeTypesByExtension('madness');
// NULL - means no data for given extension
var_dump($mimeTypes);

$extensions = Tools\MimeTypesExtensions::GetExtensionsByMimeType('application/msword');
// ['doc','dot'] - means mimetype `application/msword` could have two different extensions
var_dump($extensions);

$extensions = Tools\MimeTypesExtensions::GetExtensionsByMimeType('video/bmpeg');
// [''] - means file type is defined as file always without any extension
var_dump($extensions);

$extensions = Tools\MimeTypesExtensions::GetExtensionsByMimeType('something/crazy');
// NULL - means no data for given mimetype
var_dump($extensions);
```

### Building fresh version

[](#building-fresh-version)

```
sh scripts/build.sh
# scripts/build.bat
```

### Tests

[](#tests)

```
sh scripts/test.sh
# scripts/test.bat
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

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

Every ~1403 days

Total

2

Last Release

538d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

pluginframeworkvalidationHTML5validatemvcextensionplug-informFormsextdynamic formssubmitweb formsvalidatingmvccoresubmittingmvccore form

### Embed Badge

![Health badge](/badges/mvccore-ext-tool-mimetype-extension/health.svg)

```
[![Health](https://phpackages.com/badges/mvccore-ext-tool-mimetype-extension/health.svg)](https://phpackages.com/packages/mvccore-ext-tool-mimetype-extension)
```

PHPackages © 2026

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