DOES::walkDirectory

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. DOES
  4. walkDirectory
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher.php
  • Класс: BitrixTasksDOES
  • Вызов: DOES::walkDirectory
static function walkDirectory($dir, &$index, $rootDir)
{
	$fullDir = $rootDir.$dir;

	if(!is_readable($fullDir))
		return;

	if(is_file($fullDir))
	{
		$index['FILE'][] = $dir;
		return;
	}
	elseif(is_dir($fullDir) && (string) $dir != '')
	{
		$index['DIR'][] = $dir;
		sort($index['DIR'], SORT_STRING);
	}

	foreach(new DirectoryIterator($fullDir) as $entry)
	{
		if($entry->isDot())
		{
			continue;
		}

		$file = $dir.'/'.$entry->getFilename();
		static::walkDirectory($file, $index, $rootDir);
	}
}

Добавить комментарий