• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/update/stepper.php
  • Класс: BitrixMainUpdateStepper
  • Вызов: Stepper::__destruct
public function __destruct()
{
	if (!empty(self::$filesToUnlink))
	{
		while ($file = array_pop(self::$filesToUnlink))
		{
			$file = CBXVirtualIo::GetInstance()->GetFile($file);

			$langDir = $fileName = "";
			$filePath = $file->GetPathWithName();
			while(($slashPos = mb_strrpos($filePath, "/")) !== false)
			{
				$filePath = mb_substr($filePath, 0, $slashPos);
				$langPath = $filePath."/lang";
				if(is_dir($langPath))
				{
					$langDir = $langPath;
					$fileName = mb_substr($file->GetPathWithName(), $slashPos);
					break;
				}
			}
			if ($langDir <> "" && ($langDir = CBXVirtualIo::GetInstance()->GetDirectory($langDir)) &&
				$langDir->IsExists())
			{
				$languages = $langDir->GetChildren();
				foreach ($languages as $language)
				{
					if ($language->IsDirectory() &&
						($f = CBXVirtualIo::GetInstance()->GetFile($language->GetPathWithName().$fileName)) &&
						$f->IsExists())
					{
						$f->unlink();
					}
				}
				unset($f);
			}
			$file->unlink();
		}
		unset($file);
	}
}