<?php
$basepath = $argv[1];
$fileList = array();
$fileList = getFileList($basepath, $fileList);
print_r($fileList);
@access
@param
@param
function getFileList($path, &$buf)
{
if ( is_dir($path) )
{
if ( $dh = opendir($path) )
{
while (false !== ($entry = readdir($dh)))
{
$realPath = realpath($path) . DIRECTORY_SEPARATOR . $entry;
if ("." !== $entry && ".." !== $entry && __FILE__ !== $realPath)
{
$buf[] = $realPath;
if ( is_dir($realPath) )
{
getFileList($realPath, $buf);
}
}
}
closedir($dh);
}
}
}
?>