$sub_filters */ class Filter { /* ************************************************************************************************* * Leaf mode ************************************************************************************************* */ /** * The attribute name * @var string|null */ private $attr_name; /** * The operator * @var string|null */ private $op; /** * The attribute value pattern * @var string|null */ private $pattern; /* ************************************************************************************************* * Combine mode ************************************************************************************************* */ /** * The logical operator * @var string|null */ private $log_op; /** * The LDAP sub-filters objects * @var array|null */ private $sub_filters; /* ************************************************************************************************* * Some constants ************************************************************************************************* */ /** * List of possible logical operators * @var array */ private static $log_ops = array('&', '|', '!'); /** * List of logical operators aliases * @var array */ private static $log_op_aliases = array('and' => '&', 'or' => '|', 'not' => '!'); /** * The NOT logical operator * @var string */ private static $not_op = '!'; /** * List of possible operators * @var array */ private static $ops = array('=', '<', '>', '<=', '>=', '~='); /** * List of operators aliases * @var array */ private static $op_aliases = array( 'equals' => '=', '==' => '=', 'lower' => '<', 'greater' => '>', 'lower_or_equals' => '<=', 'greater_or_equals' => '>=', 'approx' => '~=', ); /** * Characters to escape in a LDAP filter string * @var array */ private static $espace_chars = array ( '\\' => '\5c', // \ '(' => '\28', // ( ')' => '\29', // ) '*' => '\2a', // * "\u{0000}" => '\00', // NUL ); /** * Regex to match on OID * @var string */ private static $oid_regex = '/^[0-9]+(\.[0-9]+)+$/'; /** * Regex to match attribute name * @var string */ private static $attr_name_regex = '/^(?P[a-zA-Z][a-zA-Z0-9\-]*)(;(?P