• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/io/directory.php
  • Класс: BitrixMainIODirectory
  • Вызов: Directory::deleteInternal
static function deleteInternal($path)
{
	if (is_file($path) || is_link($path))
	{
		if (!@unlink($path))
			throw new FileDeleteException($path);
	}
	elseif (is_dir($path))
	{
		if ($handle = opendir($path))
		{
			while (($file = readdir($handle)) !== false)
			{
				if ($file == "." || $file == "..")
					continue;

				self::deleteInternal(Path::combine($path, $file));
			}
			closedir($handle);
		}
		if (!@rmdir($path))
			throw new FileDeleteException($path);
	}

	return true;
}