function appendRecursive($archive, $sourceDir, $prefix) { $context = new ArchiveContext(); $context->archive = $archive; $context->prefix = $prefix; ezcBaseFile::walkRecursive($sourceDir, array(), array(), 'findRecursiveCallback', $context); }
public static function findRecursive($sourceDir, array $includeFilters = array(), array $excludeFilters = array()) { // create the context, and then start walking over the array $context = new ezcBaseFileFindContext(); ezcBaseFile::walkRecursive($sourceDir, $includeFilters, $excludeFilters, array('myProgressFinder', 'findRecursiveCallback'), $context); // collect the statistics (which we don't do anything with in this example) $statistics['size'] = $context->size; $statistics['count'] = $context->count; // return the found and pattern-matched files sort($context->elements); return $context->elements; }
/** * Uses the walker in ezcBaseFile to find files. * * This also uses the callback to get progress information about the file search. * * @param string $sourceDir * @param array $includeFilters * @param array $excludeFilters * @param eZAutoloadGenerator $gen * @return array */ public static function findRecursive($sourceDir, array $includeFilters = array(), array $excludeFilters = array(), eZAutoloadGenerator $gen) { $gen->log("Scanning for PHP-files."); $gen->startProgressOutput(self::OUTPUT_PROGRESS_PHASE1); // create the context, and then start walking over the array $context = new ezpAutoloadFileFindContext(); $context->generator = $gen; ezcBaseFile::walkRecursive($sourceDir, $includeFilters, $excludeFilters, array('eZAutoloadGenerator', 'findRecursiveCallback'), $context); // return the found and pattern-matched files sort($context->elements); $gen->stopProgressOutput(self::OUTPUT_PROGRESS_PHASE1); $gen->log("Scan complete. Found {$context->count} PHP files."); return $context->elements; }