• Модуль: documentgenerator
  • Путь к файлу: ~/bitrix/modules/documentgenerator/lib/storage/file.php
  • Класс: BitrixDocumentGeneratorStorageFile
  • Вызов: File::readFromCloud
protected function readFromCloud($path)
{
	$uri = new Uri($path);
	if($uri->getHost() <> '')
	{
		if(mb_strpos($uri->getHost(), CBXPunycode::PREFIX) === false)
		{
			$errors = array();
			if(defined("BX_UTF"))
			{
				$punycodedPath = CBXPunycode::ToUnicode($uri->getHost(), $errors);
			}
			else
			{
				$punycodedPath = CBXPunycode::ToASCII($uri->getHost(), $errors);
			}

			if($punycodedPath != $uri->getHost())
			{
				$uri->setHost($punycodedPath);
			}
		}
		$path = $uri->getLocator();

		$fileArray = CFile::makeFileArray($path);
		if($fileArray && $fileArray['tmp_name'])
		{
			return CBXVirtualIo::getInstance()->getLogicalName($fileArray['tmp_name']);
		}
	}

	return false;
}