graphonline/core/func/page_editor.php
2017-04-15 01:34:36 +03:00

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);
}
}
?>