{"id":13704307,"url":"https://github.com/dflydev/dflydev-canal","last_synced_at":"2025-10-31T10:03:33.304Z","repository":{"id":6204576,"uuid":"7435469","full_name":"dflydev/dflydev-canal","owner":"dflydev","description":"Analyze content to determine the appropriate Internet media type","archived":false,"fork":false,"pushed_at":"2023-08-28T10:40:54.000Z","size":149,"stargazers_count":34,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-13T11:38:44.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dflydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-01-04T05:00:13.000Z","updated_at":"2024-02-28T20:14:30.000Z","dependencies_parsed_at":"2023-09-25T01:44:17.745Z","dependency_job_id":null,"html_url":"https://github.com/dflydev/dflydev-canal","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"668af213d86f0f378f5dcce6799b974044fa6a51"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-canal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-canal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-canal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-canal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflydev","download_url":"https://codeload.github.com/dflydev/dflydev-canal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226779851,"owners_count":17680772,"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":[],"created_at":"2024-08-02T21:01:07.284Z","updated_at":"2025-10-31T10:03:33.229Z","avatar_url":"https://github.com/dflydev.png","language":"PHP","funding_links":[],"categories":["Files","文件","文件 Files","目录","文件操作( Files )"],"sub_categories":["文件 Files"],"readme":"Canal\n=====\n\nContent analysis for the purpose of determining [Internet media types][1].\n\n\nRequirements\n------------\n\n * PHP 5.3+\n\n\nInstallation\n------------\n \nThrough [Composer][2] as [dflydev/canal][3].\n\n\nUsage\n-----\n\n```php\n\u003c?php\n\n// Instantiate the Analyzer\n$analyzer = new Dflydev\\Canal\\Analyzer\\Analyzer;\n\n// Detect a media type from a filename (file does not need to exist)\n$internetMediaType = $analyzer-\u003edetectFromFilename('/path/to/whatever.png');\n\n// See the media type as a string\nprint $internetMediaType-\u003easString().\"\\n\\n\";\n\n// See the media type's type\nprint $internetMediaType-\u003egetType().\"\\n\\n\";\n\n// See the media type's subtype\nprint $internetMediaType-\u003egetSubtype().\"\\n\\n\";\n\n// image/png\n//\n// image\n//\n// png\n```\n\n\nLicense\n-------\n\nMIT, see LICENSE.\n\n\nNot Invented Here\n-----------------\n\nThis work was heavily influenced by [Apache Tika][4] and [Ferret][5].\n\n\n[1]: http://en.wikipedia.org/wiki/Internet_media_type\n[2]: http://getcomposer.org\n[3]: https://packagist.org/packages/dflydev/canal\n[4]: http://tika.apache.org\n[5]: https://github.com/versionable/Ferret","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-canal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflydev%2Fdflydev-canal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-canal/lists"}