An open API service indexing awesome lists of open source software.

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

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