mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-01 07:15:29 +00:00
35 lines
995 B
PHP
Executable File
35 lines
995 B
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Рекурсивно получить все файлы и папки
|
|
*/
|
|
function PageEditorGetListFilesDirs($folder, &$allFiles)
|
|
{
|
|
$fp = is_readable($folder) ? opendir($folder) : false;
|
|
if ($fp)
|
|
{
|
|
$file = readdir($fp);
|
|
|
|
while ($file !== false)
|
|
{
|
|
$path = $folder . "/" . $file;
|
|
|
|
if (is_file($path))
|
|
{
|
|
if (substr($path, -4) == ".php")
|
|
{
|
|
$allFiles[] = $folder . "/" . $file;
|
|
}
|
|
}
|
|
elseif ($file != "." && $file != ".." && is_dir($path))
|
|
{
|
|
$allFiles[] = $folder . "/" . $file . "/";
|
|
PageEditorGetListFilesDirs($path, $allFiles);
|
|
}
|
|
|
|
$file = readdir($fp);
|
|
}
|
|
closedir($fp);
|
|
}
|
|
}
|
|
?>
|