https://github.com/tomnomnom/phpsecuritytxt
A security.txt parser for PHP
https://github.com/tomnomnom/phpsecuritytxt
Last synced: 9 months ago
JSON representation
A security.txt parser for PHP
- Host: GitHub
- URL: https://github.com/tomnomnom/phpsecuritytxt
- Owner: tomnomnom
- Created: 2017-08-31T19:50:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-08T10:20:20.000Z (over 8 years ago)
- Last Synced: 2025-04-11T04:12:27.102Z (9 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: SecurityTxt/Parser.php
Awesome Lists containing this project
README
# PHP security.txt parser
Work in progress.
## Install
Install from [packagist](https://packagist.org/packages/tomnomnom/phpsecuritytxt):
```
▶ composer require tomnomnom/phpsecuritytxt
```
## Usage
Parse a `security.txt` file:
```php
parse($raw);
```
Get contact info:
```php
contact() as $contact){
echo "Contact: {$contact}\n";
}
```
Get encryption info:
```php
encryption() as $encryption){
echo "Encryption link: {$encryption}\n";
}
```
Get acknowledgement info:
```php
acknowledgement() as $acknowledgement){
echo "Acknowledgement link: {$acknowledgement}\n";
}
```
Get parser errors:
```php
errors() as $error){
echo "Error: {$error}\n";
}
```
Get comments:
```php
comments() as $comment){
echo "Comment: {$comment}\n";
}
```
## TODO
* Add support for fetching URLs directly
* Improve test coverage
* Set up travis to run tests