{"id":21819409,"url":"https://github.com/dflydev/dflydev-snort","last_synced_at":"2026-04-18T14:03:50.672Z","repository":{"id":6337038,"uuid":"7572761","full_name":"dflydev/dflydev-snort","owner":"dflydev","description":"Sniff content to determine things about it.","archived":false,"fork":false,"pushed_at":"2013-01-13T17:17:18.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T10:11:36.606Z","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}},"created_at":"2013-01-12T07:14:56.000Z","updated_at":"2017-04-01T10:17:11.000Z","dependencies_parsed_at":"2022-09-02T21:50:22.482Z","dependency_job_id":null,"html_url":"https://github.com/dflydev/dflydev-snort","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dflydev/dflydev-snort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-snort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-snort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-snort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-snort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflydev","download_url":"https://codeload.github.com/dflydev/dflydev-snort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fdflydev-snort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-27T16:19:00.669Z","updated_at":"2026-04-18T14:03:45.650Z","avatar_url":"https://github.com/dflydev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Snort\n=====\n\nSniff content to determine things about it.\n\nPartial implementation of [Content-Type Processing Model draft][1] as inspired\nby [Apache Tika][4].\n\n\nRequirements\n------------\n\n * PHP 5.3+\n\n\nInstallation\n------------\n\nThrough [Composer][2] as [dflydev/snort][3].\n\n\nUsage\n-----\n\n```php\n\u003c?php\n\nrequire __DIR__.'/vendor/autoload.php';\n\n$resource = fopen('/path/to/a/file', 'r');\n$bytes = fread($resource, 512);\n\n$buffer = new Dflydev\\Snort\\Buffer\\Buffer;\n$buffer-\u003eaddData($bytes, 0, strlen($bytes));\n\n$sniffer = new Dflydev\\Snort\\TextOrBinary\\TextOrBinarySniffer;\n\nif ($sniffer-\u003eisLikelyText($buffer)) {\n\tprint \"Well, probably text? (as best as we can guess in 512 bytes...)\\n\";\n}\n\nif ($sniffer-\u003eisLikelyBinary($buffer)) {\n\tprint \"Well, probably binary? (as best as we can guess in 512 bytes...)\\n\";\n}\n\nif ($sniffer-\u003eisMostlyAscii($buffer)) {\n    print \"Yup, Mostly ASCII!\\n\";\n}\n\nif ($sniffer-\u003elooksLikeUtf8($buffer)) {\n    print \"Yup, UTF-8!\\n\";\n}\n```\n\n\nLicense\n-------\n\nMIT, see LICENSE.\n\n\nCommunity\n---------\n\nIf you have questions or want to help out, join us in the **#dflydev** channel\non **irc.freenode.net** or mention [@dflydev][5] on Twitter.\n\n\nNot Invented Here\n-----------------\n\nThis work was heavily influenced by [Apache Tika][4] and the information\navailable from the [Content-Type Processing Model draft][1].\n\n\n[1]: http://tools.ietf.org/html/draft-abarth-mime-sniff-01\n[2]: http://getcomposer.org\n[3]: https://packagist.org/packages/dflydev/snort\n[4]: http://tika.apache.org\n[5]: https://twitter.com/dflydev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-snort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflydev%2Fdflydev-snort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fdflydev-snort/lists"}