* @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL * @version CVS: $Id: MinSize.php,v 1.5 2005/04/21 10:01:47 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ require_once "File/Archive/Predicate.php"; /** * Keep only the files larger than a given size * * @see File_Archive_Predicate, File_Archive_Reader_Filter */ class File_Archive_Predicate_MinSize extends File_Archive_Predicate { var $minSize = 0; /** * @param int $minSize minimal size of the file (in Bytes) */ function File_Archive_Predicate_MinSize($minSize) { $this->minSize = $minSize; } /** * @see File_Archive_Predicate::isTrue() */ function isTrue(&$source) { $stat = $source->getStat(); return !isset($stat[7]) || $stat[7]>=$this->minSize; } } ?>