This PHP class sniffs the MIME type of many common types of files.
Version 2 re-implements the API such that it more closely follows PSR-2. We have also purged those ugly tests and have started using PHPUnit and Composer.
This software is put in the public domain. Why? Because I can't be bothered chasing it everywhere. Call me lazy, eh.
So, I guess what my point is, is that you may use it however you like. Feel free to clone, modify, poke it, play around. Sell it. I don't mind.
For your convenience, it is available on packagist for use with composer. Just tell your code monkey to run the following:
composer require shanept/mime-sniffer
You may, of course, download the file and include it in your projects. But that'd be too easy! ;)
All contributions are appreciated. Please, create a pull request!
Thank you, CoR, for #1, your input and kind words!