• Модуль: clouds
  • Путь к файлу: ~/bitrix/modules/clouds/classes/general/storage.php
  • Класс: CCloudStorage
  • Вызов: CCloudStorage::DeleteDirFilesEx
static function DeleteDirFilesEx($path)
{
	$path = rtrim($path, "/")."/";
	foreach (CCloudStorageBucket::GetAllBuckets() as $bucket)
	{
		$obBucket = new CCloudStorageBucket($bucket["ID"]);
		if (
			$obBucket->Init()
			&& ($bucket->READ_ONLY == "N")
			&& ($bucket->ACTIVE == "Y")
		)
		{
			$arCloudFiles = $obBucket->ListFiles($path, true);
			if (is_array($arCloudFiles["file"]))
			{
				foreach ($arCloudFiles["file"] as $i => $file_name)
				{
					$tmp = $obBucket->DeleteFile($path.$file_name);
					if ($tmp)
						$obBucket->DecFileCounter($arCloudFiles["file_size"][$i]);
				}
			}
		}
	}
}