PHP Класс Imbo\EventListener\StatsAccess

This event listener lets you control the access to the /stats endpoint by white-/blacklisting ip addresses or subnets (using CIDR notation). If you disable the listener from the configuration it will be open to anyone (and it does not require an access token by default).
Автор: Christer Edvartsen ([email protected])
Наследование: implements Imbo\EventListener\ListenerInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $params = [] ) Class constructor
checkAccess ( Imbo\EventManager\EventInterface $event )
getSubscribedEvents ( )

Приватные методы

Метод Описание
cidr4Match ( string $ip, string $range ) : boolean Check an IPv4 address is in a subnet
cidr6Match ( string $ip, string $range ) : boolean Check an IPv6 address is in a subnet
cidrMatch ( string $ip, string $range ) : boolean Check if an IP address is in a subnet
expandIPv6 ( string $ip ) : string Expand a short IPv6
expandIPv6InFilters ( string &$ip ) Expand all IPv6 addresses in a filter
getBinaryMask ( integer $mask ) : string Fetch the binary representation of a mask
isAllowed ( string $ip ) : boolean See if an IP address is allowed
isIPv4 ( string $ip ) : boolean Check if an IP address ia an IPv4 address or not
isIPv6 ( string $ip ) : boolean Check if an IP address is an IPv6 address or not

Описание методов

__construct() публичный Метод

Class constructor
public __construct ( array $params = [] )
$params array Parameters for the listener

checkAccess() публичный Метод

public checkAccess ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface

getSubscribedEvents() публичный статический Метод

public static getSubscribedEvents ( )