File_Archive introduces the concept of filters to be able to select the files from a source. A filter is a particular reader that you can create with the File_Archive::filter() function. This function requires you to give a predicate. You can build this predicate using the File_Archive::pred* functions.
The standard logic predicates are:
predTrue(): always evaluates to true
predFalse(): always evaluates to false
predAnd($p1, $p2, ...): evaluates to
$p1 && $p2 && ...
predOr($p1, $p2, ...): evaluates to
$p1 || $p2 || ...
predNot($p): evaluates to
Some other predicats will help you filtering the files:
keep only the files
which size is
>= $size (in bytes).
predMinTime($time): keep only the files that have been modified after $time (unix timestamp).
keep only the files that
have a public name with less than
predExtension($list): keep only the files with a given
$list is an array or a comma separated string of
predEreg($ereg): keep only the files that have a public name that matches the given regular expression.
predEregi($ereg): same as predEreg(), but the test is case insensitive.
predMIME($mimes): Select files with a certain MIME type. You can pass an array of types or a string, and use wildcards.
//Extract all the files that contain an 'a' in their path
// or filename from a tar archive
//Compress a directory to a zip file, including only the files
//smaller than 1MB that have changed since last hour
File_Archive::predMinSize(1024 * 1024)