# thephpleague/mime-type-detection

League Mime Type Detection

Repository: https://github.com/thephpleague/mime-type-detection
Canonical: https://ross.abutalabs.com/products/mime-type-detection
Homepage: https://flysystem.thephpleague.com/
Language: PHP
License: MIT
License Family: permissive
Last push: 2026-07-09T15:00:00+00:00

## Health v2 (maintenance only)
Score: 73/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 91, release rhythm 35, longevity 100
- inputs: {"age_days": 2380, "days_push": 55, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1339, forks 29 (observed 2026-08-28T04:04:25.904168+00:00)

## What it is
A PHP library providing a generic MIME type detection interface with a finfo-based implementation and extension fallback. It is the MIME detection component used by the Flysystem file storage abstraction.

## Use cases
- detect the mime type of a file in php
- get mime type from file contents
- look up mime types by file extension
- validate uploaded file types in php
- determine content type for http responses

## When to choose
- you need reliable MIME detection in a PHP project
- you use Flysystem and need its MIME detection dependency
- you want to detect types from contents with extension fallback

## When to avoid
- you need deep file format inspection beyond MIME types
- you are not working in PHP

## Facets
- artifact type: library
- maturity: stable
- function: file-system, developer-tools
- domain: files, developer-tools
- platform: php, cross-platform
- tags: mime-type, file-detection, flysystem, php-library

## Member repositories
- thephpleague/mime-type-detection (main) score 73

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:25.904168+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:43:56.947990+00:00, confidence not recorded.
  - readme: https://github.com/thephpleague/mime-type-detection (fetched 2026-08-28T04:04:25.904168+00:00, sha cc19222db65b)
  - homepage: https://flysystem.thephpleague.com/ (fetched 2026-08-29T12:02:58.818396+00:00, sha 13d04ca15538)
  - site_page: https://flysystem.thephpleague.com/docs (fetched 2026-08-29T12:02:58.827469+00:00, sha beea9b4a6ef8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
