public static function mime($file = false) { $ext = substr(strrchr($file, '.'), 1); if (!self::$_MME) { if (!file_exists($path = CORE . 'mimes' . EXT)) { return false; } include $path; if (!is_array($_MME)) { return false; } self::$_MME = $_MME; unset($_MME); } if (!array_key_exists($ext, self::$_MME)) { return false; } // if the extension has multiple mime types, return the first one. if (is_array(self::$_MME[$ext])) { return Arrays::first(self::$_MME[$ext]); } return self::$_MME[$ext]; }