PHP 클래스 Vectorface\Whip\IpRange\IpWhitelist

저자: Daniel Bruce ([email protected])
파일 보기 프로젝트 열기: vectorface/whip 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $whitelists ) Constructor for the class.
isIpWhitelisted ( string $ipAddress ) : boolean Returns whether or not the given IP address is within the whitelist.

비공개 메소드들

메소드 설명
constructWhiteListForKey ( array $whitelist, string $key, string $class ) : array Constructs the whitelist for the given key. Each element in the whitelist gets mapped from a string to an instance of an Ipv4Range or Ipv6Range.
isIpInWhitelist ( array $whitelist, string $ipAddress ) : boolean Returns whether or not the given IP address is in the given whitelist.

메소드 상세

__construct() 공개 메소드

Constructor for the class.
public __construct ( array $whitelists )
$whitelists array An array with two keys ('ipv4' and 'ipv6') with each key mapping to an array of valid IP ranges.

isIpWhitelisted() 공개 메소드

Returns whether or not the given IP address is within the whitelist.
public isIpWhitelisted ( string $ipAddress ) : boolean
$ipAddress string A valid IPv4 or IPv6 address.
리턴 boolean Returns true if the IP address matches one of the whitelisted IP ranges and false otherwise.