Original code passed with flying colors using Code Review module. Ran it
through PHP_CodeSniffer and it found a crazy amount of errors.
Should be fixed now though.
Quick patch to the pull request I made. I should have used DRUPAL_ROOT
instead of the php document root variable as the patch didn't work on a
second system otherwise
A SimpleTest file has also been included to allow you to test this file
for errors.
Please note the require once directive at the top of
tests/MimeClass.test. I am not sure if this is Drupal kosher, but the
test wouldn't work without it.
There is probably a way around this include statement but I will leave
this to the Drupal experts.
Note that the Drupal 7 function file_mimetype_mapping has a Drupal alter
statement:
// Allow modules to alter the default mapping.
drupal_alter('file_mimetype_mapping', $mapping);
using this hook, you can add to this internal mime type list without
updating drupal core.
Hope this helps! If there are any questions please feel free to email me
at andrewfreddin@gmail.com