Skip to content

jpkleemans/firewall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firewall

License

Easy access control for PHP

This library is currently under development. Things will change. Things will break.

Install

Via Composer

$ composer require jpkleemans/firewall:dev-master

Usage

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

$ phpspec run

About

Easy access control for PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages