+ Подробные коменты в не [[]]
This commit is contained in:
@ -314,6 +314,43 @@ function deleteTempFiles($dir)
|
||||
}
|
||||
}
|
||||
|
||||
function getFilesTree($dir,$cut="",$result = null){
|
||||
if($result==null)
|
||||
$result = new stdClass();
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$result->list = array();
|
||||
|
||||
$dh = opendir($dir);
|
||||
if ($dh)
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if($file == '..' || $file == '.') continue;
|
||||
|
||||
if(is_dir($dir.DIRECTORY_SEPARATOR.$file)){
|
||||
$sub = new stdClass();
|
||||
$sub->name=$file;
|
||||
$sub->path=$dir.DIRECTORY_SEPARATOR.$file;
|
||||
if($cut) $sub->path = str_replace($cut, "",$sub->path);
|
||||
array_push($result->list, $sub);
|
||||
getFilesTree($dir.DIRECTORY_SEPARATOR.$file, $cut, $sub);
|
||||
}else{
|
||||
$sub = new stdClass();
|
||||
$sub->name=$file;
|
||||
$sub->path=$dir.DIRECTORY_SEPARATOR.$file;
|
||||
if($cut) $sub->path = str_replace($cut, "",$sub->path);
|
||||
array_push($result->list, $sub);
|
||||
}
|
||||
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
//Генерация пароля
|
||||
function getPassword($max)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user