spaces > tabs
This commit is contained in:
parent
ef6a7289bb
commit
b2d8b41388
@ -1257,39 +1257,39 @@ function full_copy($source, $target) {
|
|||||||
* @return array file list
|
* @return array file list
|
||||||
*/
|
*/
|
||||||
function list_files(/*string*/ $base, $_sub_dir="") {
|
function list_files(/*string*/ $base, $_sub_dir="") {
|
||||||
assert(is_dir($base));
|
assert(is_dir($base));
|
||||||
|
|
||||||
$file_list = array();
|
$file_list = array();
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
$dir = opendir("$base/$_sub_dir");
|
$dir = opendir("$base/$_sub_dir");
|
||||||
while($f = readdir($dir)) {
|
while($f = readdir($dir)) {
|
||||||
$files[] = $f;
|
$files[] = $f;
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
sort($files);
|
sort($files);
|
||||||
|
|
||||||
foreach($files as $filename) {
|
foreach($files as $filename) {
|
||||||
$full_path = "$base/$_sub_dir/$filename";
|
$full_path = "$base/$_sub_dir/$filename";
|
||||||
|
|
||||||
if(is_link($full_path)) {
|
if(is_link($full_path)) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
else if(is_dir($full_path)) {
|
else if(is_dir($full_path)) {
|
||||||
if($filename == "." || $filename == "..") {
|
if($filename == "." || $filename == "..") {
|
||||||
$file_list = array_merge(
|
$file_list = array_merge(
|
||||||
$file_list,
|
$file_list,
|
||||||
list_files($base, "$_sub_dir/$filename")
|
list_files($base, "$_sub_dir/$filename")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$full_path = str_replace("//", "/", $full_path);
|
$full_path = str_replace("//", "/", $full_path);
|
||||||
$file_list[] = $full_path;
|
$file_list[] = $full_path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $file_list;
|
return $file_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user