{"id":15026177,"url":"https://github.com/narrowspark/mimetypes","last_synced_at":"2025-10-03T23:32:28.188Z","repository":{"id":44893741,"uuid":"102120834","full_name":"narrowspark/mimetypes","owner":"narrowspark","description":":dart: PHP MIME Types Guesser and extension mapping.","archived":true,"fork":false,"pushed_at":"2022-06-26T09:04:15.000Z","size":643,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T09:59:42.026Z","etag":null,"topics":["mime","mime-db","mime-types","mimetypes","php-mime","php72","php73"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narrowspark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-01T14:24:13.000Z","updated_at":"2023-03-01T10:38:00.000Z","dependencies_parsed_at":"2022-09-15T11:14:10.406Z","dependency_job_id":null,"html_url":"https://github.com/narrowspark/mimetypes","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fmimetypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fmimetypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fmimetypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Fmimetypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narrowspark","download_url":"https://codeload.github.com/narrowspark/mimetypes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235204448,"owners_count":18952326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mime","mime-db","mime-types","mimetypes","php-mime","php72","php73"],"created_at":"2024-09-24T20:03:56.725Z","updated_at":"2025-10-03T23:32:22.916Z","avatar_url":"https://github.com/narrowspark.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003eMIME Types\u003c/h2\u003e\n\u003ch3 align=\"center\"\u003ePHP MIME Types Guesser and extension mapper.\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/narrowspark/mimetypes/releases\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/narrowspark/mimetypes.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://php.net/\"\u003e\u003cimg src=\"https://img.shields.io/badge/php-%5E7.2.0-8892BF.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/narrowspark/mimetypes\"\u003e\u003cimg src=\"https://img.shields.io/travis/rust-lang/rust/master.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/narrowspark/mimetypes\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/narrowspark/mimetypes/master.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"http://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nbuilt with [jshttp/mime-db][1].\n\nMime types mapping, the right way.\n------------\nThis library uses [jshttp/mime-db][1] as its default mapping which aggregates data from multiple sources and creates a single ```db.json``` making it the most complete mapping.\n- [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml)\n- [Apache](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)\n- [Nginx](http://hg.nginx.org/nginx/file/tip/conf/mime.types)\n\nInstallation\n------------\n\n```bash\ncomposer require narrowspark/mimetypes\n```\n\nUse\n------------\n\nThis mime type guesser has support for all OS supported guesser.\n\n```php\n\u003c?php\n    use Narrowspark\\MimeType\\MimeType;\n    \n    // You can register custom guessers by calling the register() method\n    MimeType::register('CustomGuesser');\n\n    return MimeType::guess('image.gif'); // returns image/gif\n```\n\nYou looking for the full mime type array? Just use:\n\n```php\n\u003c?php\n    use Narrowspark\\MimeType\\MimeTypesList;\n\n    return MimeTypesList::MIMES; // returns array\n```\n\nIf you like to use the build in php mime type guesser, just use:\n\n```php\n\u003c?php\n    use Narrowspark\\MimeType\\MimeTypeFileInfoGuesser;\n    use Narrowspark\\MimeType\\MimeTypeFileBinaryGuesser;\n    use Narrowspark\\MimeType\\MimeTypeExtensionGuesser;\n    use Narrowspark\\MimeType\\MimeTypeFileExtensionGuesser;\n\n    \n    // Inspecting the file using finfo and relies on magic db files.\n    return MimeTypeFileInfoGuesser::guess('image.gif'); // returns image/gif\n    // Inspecting the file using file -b --mime\n    return MimeTypeFileBinaryGuesser::guess('image.gif'); // returns image/gif\n    // Inspecting the extension using mime type list\n    return MimeTypeExtensionGuesser::guess('gif'); // returns image/gif\n    // Inspecting the file using mime type list\n    return MimeTypeFileExtensionGuesser::guess('image.gif'); // returns image/gif\n```\n\nContributing\n------------\n\nIf you would like to help take a look at the [list of issues](http://github.com/narrowspark/mimetypes/issues) and check our [Contributing](CONTRIBUTING.md) guild.\n\n\u003e **Note:** Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.\n\nLicense\n---------------\n\nThe Narrowspark mimetypes is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n\n[1]: http://github.com/jshttp/mime-db\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarrowspark%2Fmimetypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarrowspark%2Fmimetypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarrowspark%2Fmimetypes/lists"}