mirror of
https://github.com/php/doc-base.git
synced 2026-03-25 07:42:16 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/doc-base/trunk@312466 c90b9560-bf6c-de11-be94-00142212c4b1
26 lines
453 B
PHP
26 lines
453 B
PHP
<?php
|
|
function list_files($basedir, $extensions = array('xml')) {
|
|
|
|
if (!is_dir($basedir)) {
|
|
return false;
|
|
}
|
|
|
|
$files = array();
|
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
|
|
|
|
if (!$file->isFile()) {
|
|
continue;
|
|
}
|
|
|
|
$filepath = $file->getPathname();
|
|
|
|
if (!in_array(pathinfo($filepath, PATHINFO_EXTENSION), $extensions)) {
|
|
continue;
|
|
}
|
|
|
|
$files[] = $filepath;
|
|
}
|
|
return $files;
|
|
}
|
|
|