2017 © Pedro Peláez
 

library phpsecuritytxt

A parser for security.txt files

image

tomnomnom/phpsecuritytxt

A parser for security.txt files

  • Sunday, October 8, 2017
  • by TomNomNom
  • Repository
  • 4 Watchers
  • 7 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP security.txt parser

Work in progress., (*1)

Install

Install from packagist:, (*2)

▶ composer require tomnomnom/phpsecuritytxt

Usage

Parse a security.txt file:, (*3)

<?php
$raw = file_get_contents("test/fixtures/basic.txt");

$sectxt = new \SecurityTxt\Parser($raw);

You can create and empty object and call parse() instead:, (*4)

<?php
$raw = file_get_contents("test/fixtures/basic.txt");

$sectxt = new \SecurityTxt\Parser();
$sectxt->parse($raw);

Get contact info:, (*5)

<?php
foreach ($sectxt->contact() as $contact){
    echo "Contact: {$contact}\n";
}

Get encryption info:, (*6)

<?php
foreach ($sectxt->encryption() as $encryption){
    echo "Encryption link: {$encryption}\n";
}

Get acknowledgement info:, (*7)

<?php
foreach ($sectxt->acknowledgement() as $acknowledgement){
    echo "Acknowledgement link: {$acknowledgement}\n";
}

Get parser errors:, (*8)

<?php
foreach ($sectxt->errors() as $error){
    echo "Error: {$error}\n";
}

Get comments:, (*9)

<?php
foreach ($sectxt->comments() as $comment){
    echo "Comment: {$comment}\n";
}

TODO

  • Add support for fetching URLs directly
  • Improve test coverage
  • Set up travis to run tests

The Versions

08/10 2017

dev-master

9999999-dev https://github.com/tomnomnom/phpsecuritytxt

A parser for security.txt files

  Sources   Download

MIT

The Development Requires

08/10 2017

0.0.2

0.0.2.0 https://github.com/tomnomnom/phpsecuritytxt

A parser for security.txt files

  Sources   Download

MIT

The Development Requires

31/08 2017

0.0.1

0.0.1.0 https://github.com/tomnomnom/phpsecuritytxt

A parser for security.txt files

  Sources   Download

MIT

The Development Requires