library firewall
Easy access control for PHP
jpkleemans/firewall
Easy access control for PHP
- Monday, September 28, 2015
- by jpkleemans
- Repository
- 3 Watchers
- 2 Stars
- 2 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 4 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Firewall
, (*1)
Easy access control for PHP, (*2)
This library is currently under development. Things will change. Things will break., (*3)
Install
Via Composer, (*4)
``` bash
$ composer require jpkleemans/firewall:dev-master, (*5)
## Usage
``` php
use Firewall\Adapter\HtaccessAdapter;
use Firewall\Host\IP;
// Create an instance of an adapter that implements the Firewall interface.
$firewall = new HtaccessAdapter('path/to/.htaccess');
// Create an instance of a class that implements the Host interface.
$host = IP::fromString('123.0.0.1');
// Block the host
$firewall->deny($host);
Planned Adapters
- Htaccess
- NGINX
- IIS
- HHVM
- lighttpd
- PSR-7 Middleware
Testing
bash
$ phpspec run
, (*6)