katzien/php-mime-type

This package is abandoned and no longer maintained. No replacement package was suggested.

A PHP library to detect the mime type of files.

Maintainers

👁 katzien

Package info

github.com/katzien/PhpMimeType

pkg:composer/katzien/php-mime-type

Statistics

Installs: 74 962

Dependents: 2

Suggesters: 0

Stars: 9

Open Issues: 0

2.1.0 2017-03-23 02:05 UTC

Requires

  • php: >=5.6

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 159dfbdcd5906442f3dad89951127f0b9dfa3b78

  • Kat Zien

phpmimetype

This package is not auto-updated.

Last update: 2020-01-24 15:39:24 UTC


README

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"