Create Filter.php

Provide LDAP-like filters to FileZ.

Filters handled by this class are expressions given in a syntax close to LDAP filters.

As in LDAP, the criteria are expressed as "attribute=expression" put in parenthesis. The general syntax is the same as in LDAP and the logical operators ("&", "|", "!") work the same way. The main difference with LDAP is that the expression is a non-achored PERL regular expressions instead of a Unix shell-like wildcards.

Filters are applied to associative arrays such as $_SERVER. The value of the attribute in a filter is the value of the corresponding index in the associative array.

Examples :
(REMOTE_ADDR=^192\.168\.1\.$)
    If applied to $_SERVER, it evaluates to true if the connexion has been issued from the network 192.168.1.0/24

(|(HTTP_HOST=domain1\.org$)(HTTP_HOST=domain2\.fr$))
    If applied to $_SERVER, it evaluates to true if the connexion has been issued from a host belonging to domains domain1.org or domain2.org or one of their subdomains.