PHP Class Vectorface\Whip\IpRange\Ipv4Range

Author: Daniel Bruce ([email protected])
Inheritance: implements Vectorface\Whip\IpRange\IpRange
Afficher le fichier Open project: vectorface/whip

Méthodes publiques

Méthode Description
__construct ( string $range ) Constructor for the class.
containsIp ( string $ipAddress ) : boolean Returns whether or not a given IP address falls within this range.
getLowerInt ( ) : integer Returns the lower value of the IPv4 range as a long integer.
getUpperInt ( ) : integer Returns the upper value of the IPv4 range as a long integer.

Private Methods

Méthode Description
computeLowerAndUpperBounds ( string $range ) Computes the lower and upper bounds of the IPv4 range by parsing the range string.
parseCidrRange ( string $range ) : array Parses a CIDR notation range.
parseHyphenRange ( string $range ) : array Parses a hyphen notation range.
parseWildcardRange ( string $range, integer $pos ) : array Parses a wildcard notation range.

Method Details

__construct() public méthode

Constructor for the class.
public __construct ( string $range )
$range string A valid IPv4 range as a string. Supported range styles: - CIDR notation (127.0.0.1/24) - hyphen notation (127.0.0.1-127.0.0.255) - wildcard notation (127.0.0.*) - a single specific IP address (127.0.0.1)

containsIp() public méthode

Returns whether or not a given IP address falls within this range.
public containsIp ( string $ipAddress ) : boolean
$ipAddress string The given IP address.
Résultat boolean Returns true if the IP address falls within the range and false otherwise.

getLowerInt() public méthode

Returns the lower value of the IPv4 range as a long integer.
public getLowerInt ( ) : integer
Résultat integer The lower value of the IPv4 range.

getUpperInt() public méthode

Returns the upper value of the IPv4 range as a long integer.
public getUpperInt ( ) : integer
Résultat integer The upper value of the IPv4 range.