<?php
@version
if ( !is_dir($basePath = $argv[1]))
{
echo "It is not a directory.";
}
$fileList = array();
makeFileList($basePath, $fileList);
print_r($fileList);
@access
@param
@param
function makeFileList($dirPath, &$fileList)
{
if ( !$dh = opendir($dirPath) )
{
exit;
}
while (false !== ($entry = readdir($dh)))
{
$realPath = realpath($dirPath) . DIRECTORY_SEPARATOR . $entry;
if ( "." === $entry || ".." === $entry || __FILE__ === $realPath)
{
continue;
}
$fileList[] = $realPath;
if ( is_dir($realPath) )
{
makeFileList($realPath, $fileList);
}
}
closedir($dh);
}
?>