{"id":16824964,"url":"https://github.com/tomnomnom/phpsecuritytxt","last_synced_at":"2025-04-11T04:12:32.309Z","repository":{"id":57071472,"uuid":"102039074","full_name":"tomnomnom/phpsecuritytxt","owner":"tomnomnom","description":"A security.txt parser for PHP","archived":false,"fork":false,"pushed_at":"2017-10-08T10:20:20.000Z","size":4,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T04:12:27.102Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomnomnom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SecurityTxt/Parser.php","support":null}},"created_at":"2017-08-31T19:50:39.000Z","updated_at":"2025-03-22T11:14:28.000Z","dependencies_parsed_at":"2022-08-24T14:54:27.880Z","dependency_job_id":null,"html_url":"https://github.com/tomnomnom/phpsecuritytxt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpsecuritytxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpsecuritytxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpsecuritytxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpsecuritytxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomnomnom","download_url":"https://codeload.github.com/tomnomnom/phpsecuritytxt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339225,"owners_count":21087215,"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-10-13T11:12:32.799Z","updated_at":"2025-04-11T04:12:32.283Z","avatar_url":"https://github.com/tomnomnom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP security.txt parser\n\nWork in progress.\n\n## Install\n\nInstall from [packagist](https://packagist.org/packages/tomnomnom/phpsecuritytxt):\n\n```\n▶ composer require tomnomnom/phpsecuritytxt\n```\n\n## Usage\n\nParse a `security.txt` file:\n```php\n\u003c?php\n$raw = file_get_contents(\"test/fixtures/basic.txt\");\n\n$sectxt = new \\SecurityTxt\\Parser($raw);\n```\n\nYou can create and empty object and call `parse()` instead:\n\n```php\n\u003c?php\n$raw = file_get_contents(\"test/fixtures/basic.txt\");\n\n$sectxt = new \\SecurityTxt\\Parser();\n$sectxt-\u003eparse($raw);\n```\n\nGet contact info:\n```php\n\u003c?php\nforeach ($sectxt-\u003econtact() as $contact){\n    echo \"Contact: {$contact}\\n\";\n}\n```\n\nGet encryption info:\n```php\n\u003c?php\nforeach ($sectxt-\u003eencryption() as $encryption){\n    echo \"Encryption link: {$encryption}\\n\";\n}\n```\n\nGet acknowledgement info:\n```php\n\u003c?php\nforeach ($sectxt-\u003eacknowledgement() as $acknowledgement){\n    echo \"Acknowledgement link: {$acknowledgement}\\n\";\n}\n```\n\nGet parser errors:\n```php\n\u003c?php\nforeach ($sectxt-\u003eerrors() as $error){\n    echo \"Error: {$error}\\n\";\n}\n```\n\nGet comments:\n```php\n\u003c?php\nforeach ($sectxt-\u003ecomments() as $comment){\n    echo \"Comment: {$comment}\\n\";\n}\n```\n\n## TODO\n* Add support for fetching URLs directly\n* Improve test coverage\n* Set up travis to run tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fphpsecuritytxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomnomnom%2Fphpsecuritytxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fphpsecuritytxt/lists"}