GitXplorerGitXplorer
k

PhpMimeType

public
12 stars
4 forks
0 issues

Commits

List of commits on branch master.
Unverified
159dfbdcd5906442f3dad89951127f0b9dfa3b78

Clarified the differences between versions.

kkatzien committed 8 years ago
Unverified
4c9aafc2a6be3507a74c99217f583ed27a866e5c

Use phpunit from vendor, not the Travis one

kkatzien committed 8 years ago
Unverified
2f8e7e5661eb76239db9ad2ab20456acb84b0fa7

Update version statuses

kkatzien committed 8 years ago
Unverified
e87e7d3f5621db2d6512b9bb350a34dc817a0109

Remove the dependency status from README

kkatzien committed 8 years ago
Unverified
bc658dd898f97dde226a6aa58d52a16ce0a9c068

Update the list of extensions mapped to types

kkatzien committed 8 years ago
Unverified
d2aa4a9ab7f9e7bf27030f2f1c1bfb1df4b785ed

Add 7.1 to travis builds

kkatzien committed 8 years ago

README

The README file for this repository.

PhpMimeType

A PHP library to detect the mime type of a file.

Build Status Coverage Status

Latest Stable Version Total Downloads

License

Not invented here

This is a modernised version of Jason Sheets's mimetype class.

Installation

To add the PhpMimeType library to your project run

composer require katzien/php-mime-type

from the directory where your composer.json file is.

See Packagist for more details.

Version Guidance

Version Status PHP version required
1.x Maintained min. 5.3
2.x Latest (recommended) min. 5.6

If you're using PHP 5.6 or higher, you should use the latest 2.x version. There is no difference in usage between 1.x and 2.x, so the upgrade should not require any code changes.

Differences between 1.x and 2.x:

  • syntax
  • versions of composer dependencies

Usage

$type = \MimeType\MimeType::getType('my-file.pdf'); // returns "application/pdf"