[go: up one dir, main page]

Skip to content

xianz/Ipfilter-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

IpFilter

Library for filter ips in site

Installation & Configuration

To install

ppm install ipfilter

example to add library:

$di->set('ipfilter', function () {
    $ips = ['198.140.5.38','198.140.5.39','127.0.0.1'];
    $filter = new Ipfilter\Ipfilter($ips);
    return $filter;
});

ips can accept ranges for all ips:

$di->set('ipfilter', function () {
    $ips = ['198.140.5.38/24','198.140.5.39/32'];
    $filter = new Ipfilter\Ipfilter($ips);
    return $filter;
});

execute in controller

// return true or false if your ip is in the list
$this->ipfilter->filter();

About

filter or block site by ip

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%