/** * Handles a file instance while looping an tree of directories. * * @param MCE_File $file File object reference * @param int $level Current level of tree parse * @return int State of what to do next can be CONTINUE, ABORT or ABORTFOLDER. */ function handle($file, $level) { $add = true; if (is_array($this->_array) && $this->_onlyDirs && $file->isFile()) { $add = false; } if (is_array($this->_array) && $this->_onlyFiles && $file->isDir()) { $add = false; } if ($add) { $this->_array[] = $file; } if ($this->_maxLevel && $level >= $this->_maxLevel) { return $this->ABORT_FOLDER; } return $this->CONTINUE; }