本文整理汇总了PHP中ezcBaseFile::walkRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcBaseFile::walkRecursive方法的具体用法?PHP ezcBaseFile::walkRecursive怎么用?PHP ezcBaseFile::walkRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezcBaseFile
的用法示例。
在下文中一共展示了ezcBaseFile::walkRecursive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendRecursive
function appendRecursive($archive, $sourceDir, $prefix)
{
$context = new ArchiveContext();
$context->archive = $archive;
$context->prefix = $prefix;
ezcBaseFile::walkRecursive($sourceDir, array(), array(), 'findRecursiveCallback', $context);
}
示例2: findRecursive
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;
}
示例3: findRecursive
/**
* 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;
}