https://github.com/aedart/athenaeum-mime-types
[READ ONLY] Athenaeum Mime-Types package - see https://github.com/aedart/athenaeum
https://github.com/aedart/athenaeum-mime-types
Last synced: 12 months ago
JSON representation
[READ ONLY] Athenaeum Mime-Types package - see https://github.com/aedart/athenaeum
- Host: GitHub
- URL: https://github.com/aedart/athenaeum-mime-types
- Owner: aedart
- License: bsd-3-clause
- Created: 2022-03-13T11:13:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-07-21T08:07:56.000Z (about 1 year ago)
- Last Synced: 2025-07-21T09:32:02.486Z (about 1 year ago)
- Language: PHP
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Athenaeum Mime-Types
A "profile" based [MIME-type](https://en.wikipedia.org/wiki/Media_type) detector, which uses a string or a `resource` as sample.
```php
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](https://www.php.net/manual/en/book.fileinfo.php).
## Documentation
Please read the [official documentation](https://aedart.github.io/athenaeum/) for additional information.
## Repository
The mono repository is located at [github.com/aedart/athenaeum](https://github.com/aedart/athenaeum)
## Versioning
This package follows [Semantic Versioning 2.0.0](http://semver.org/)
## License
[BSD-3-Clause](http://spdx.org/licenses/BSD-3-Clause), Read the LICENSE file included in this package