elements[] = $sourceDir . DIRECTORY_SEPARATOR . $fileName; $context->count++; $context->size += $fileInfo['size']; } static public 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 $statistics['size'] = $context->size; $statistics['count'] = $context->count; // return the found and pattern-matched files sort( $context->elements ); return $context->elements; } } $files = myProgressFinder::findRecursive( dirname( __FILE__ ) ); var_dump( $files ); ?>