* @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL * @version CVS: $Id: Index.php 2 2010-11-23 14:32:26Z oldperl $ * @link http://pear.php.net/package/File_Archive */ require_once "File/Archive/Predicate.php"; /** * Evaluates to true if the index is in a given array of indexes * The array has the indexes in key (so you may want to call * array_flip if your array has indexes as value) */ class File_Archive_Predicate_Index extends File_Archive_Predicate { var $indexes; var $pos = 0; /** * @param $extensions array or comma separated string of allowed extensions */ function File_Archive_Predicate_Index($indexes) { $this->indexes = $indexes; } /** * @see File_Archive_Predicate::isTrue() */ function isTrue(&$source) { return isset($this->indexes[$this->pos++]); } } ?>