Skip a directory when validator cannot access the directory.

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4571 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
wdlee91 2008-09-27 06:12:42 +00:00
parent 4c82c46add
commit 7ab2c814f8

View file

@ -83,18 +83,20 @@
if(substr($base_path,-1)=='/') $base_path = substr($base_path,0,-1);
if(in_array($path, $avoid_path)) return;
$oDir = dir($path);
while($item = $oDir->read()) {
if(substr($item,0,1)=='.' && $item != '.htaccess' ) continue;
$new_path = $path.'/'.$item;
if(!is_dir($new_path)) {
$filesize = filesize($new_path);
$filename = substr($new_path, strlen($base_path)+1);
$buff[$filename] = $filesize;
} else {
getFiles($new_path, $base_path, $avoid_path, $buff);
$oDir = @dir($path);
if($oDir) {
while($item = $oDir->read()) {
if(substr($item,0,1)=='.' && $item != '.htaccess' ) continue;
$new_path = $path.'/'.$item;
if(!is_dir($new_path)) {
$filesize = filesize($new_path);
$filename = substr($new_path, strlen($base_path)+1);
$buff[$filename] = $filesize;
} else {
getFiles($new_path, $base_path, $avoid_path, $buff);
}
}
$oDir->close();
}
$oDir->close();
}
?>