• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/io/directory.php
  • Класс: BitrixTranslateIODirectory
  • Вызов: Directory::wipe
public function wipe(?Closure $filter = null): bool
{
	if (!$this->isExists())
	{
		throw new MainIOFileNotFoundException($this->originalPath);
	}

	if($this->getPath() === '/')
	{
		throw new MainIOInvalidPathException($this->originalPath);
	}

	$children = $this->getChildren();
	$result = true;
	foreach ($children as $entry)
	{
		if ($filter instanceof Closure)
		{
			if ($filter($entry) !== true)
			{
				continue;
			}
		}
		$result = $entry->delete();

		if (!$result)
		{
			break;
		}
	}
	if ($result)
	{
		clearstatcache();
	}

	return $result;
}