devitools / arceau
0.0.9
2021-08-24 16:20 UTC
Requires
- php: >=7.0
- ext-json: *
- predis/predis: ^1.1
README
How to install
composer require devitools/arceau
Get started
Create a PHP file as below
<?php use Devitools\Arceau\Security\Firewall; use const Devitools\Arceau\Security\Helper\FIREWALL_ALLOW; use const Devitools\Arceau\Security\Helper\FIREWALL_DENY; /** */ return static function () { $allowed = [ 'query:code=10&t=*', '172.30.0.1', '192.168.*', ]; Firewall::instance() ->setDefaultMode(FIREWALL_DENY) ->addItem('10.0.0.*', FIREWALL_ALLOW) ->addItems($allowed, FIREWALL_ALLOW) ->handle(); };
Then use it anywhere
$firewall = require __DIR__ . '/../../firewall.php'; $firewall();