aedart/athenaeum-mime-types

Mime-Types

Maintainers

👁 aedart

Package info

github.com/aedart/athenaeum-mime-types

Homepage

pkg:composer/aedart/athenaeum-mime-types

Statistics

Installs: 28 681

Dependents: 1

Suggesters: 0

Stars: 0

10.10.0 2026-06-08 07:23 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause d861f569ba7e6ba2ea2d061360e06e0cd8c0d77a

  • Alin Eugen Deac <aedart.woop@gmail.com>

utilitiesmime-typeAthenaeum

This package is auto-updated.

Last update: 2026-06-23 06:48:11 UTC


README

A "profile" based MIME-type detector, which uses a string or a resource as sample.

use Aedart\MimeTypes\Detector;

$file = fopen('my-picture.jpg', 'rb');

// Detect mime-type by only reading xx-bytes from file...
$mimeType = (new Detector())->detect($file);
fclose($file);

print_r($mimeType);

Output example:

Aedart\MimeTypes\MimeType Object
(
 [description] => JPEG image data, JFIF standard 1.01, resolution (DPI),...
 [mime] => image/jpeg; charset=binary
 [type] => image/jpeg
 [encoding] => binary
 [known_extensions] => Array
 (
 [0] => jpeg
 [1] => jpg
 [2] => jpe
 [3] => jfif
 )
)

Behind the scene, the default profile driver uses PHP's File Info Extension.

Documentation

Please read the official documentation for additional information.

Repository

The mono repository is located at github.com/aedart/athenaeum

Versioning

This package follows Semantic Versioning 2.0.0

License

BSD-3-Clause, Read the LICENSE file included in this package