• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/io/directory.php
  • Класс: BitrixMainIODirectory
  • Вызов: Directory::getChildren
public function getChildren()
{
	if (!$this->isExists())
		throw new FileNotFoundException($this->originalPath);

	$arResult = array();

	if ($handle = opendir($this->getPhysicalPath()))
	{
		while (($file = readdir($handle)) !== false)
		{
			if ($file == "." || $file == "..")
				continue;

			$pathLogical = Path::combine($this->path, Path::convertPhysicalToLogical($file));
			$pathPhysical = Path::combine($this->getPhysicalPath(), $file);
			if (is_dir($pathPhysical))
				$arResult[] = new Directory($pathLogical, $this->siteId);
			else
				$arResult[] = new File($pathLogical, $this->siteId);
		}
		closedir($handle);
	}

	return $arResult;
}