class Ip implements RequestPatternInterface (View source)

This class holds a CIDR IP pattern an decides, if an ActionRequest object matches against this pattern, comparing the client IP address.

The pattern can contain IPv4 and IPv6 addresses (including IPv6 wrapped IPv4 addresses).

Properties

protected array $options

Methods

__construct(array $options)

Expects options in the form array('cidrPattern' => '')

bool
matchRequest(ActionRequest $request)

Matches an ActionRequest against the set IP pattern rules

Details

__construct(array $options)

Expects options in the form array('cidrPattern' => '')

Parameters

array $options

bool matchRequest(ActionRequest $request)

Matches an ActionRequest against the set IP pattern rules

Parameters

ActionRequest $request

The request that should be matched

Return Value

bool

true if the pattern matched, false otherwise

Exceptions

InvalidRequestPatternException