• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/iblockxmlimport.php
  • Класс: CIBlockXmlImport
  • Вызов: CIBlockXmlImport::openXmlFile
private function openXmlFile(): void
{
	$this->closeXmlFile();

	if ($this->fileParameters['ABSOLUTE_PATH'] == '')
	{
		$this->addError(Loc::getMessage('IBLOCK_XML_IMPORT_ERR_OPEN_XML_FILE'));

		return;
	}
	$this->fileHandler = fopen($this->fileParameters['ABSOLUTE_PATH'], 'rb');
	if (!is_resource($this->fileHandler))
	{
		$this->addError(Loc::getMessage('IBLOCK_XML_IMPORT_ERR_OPEN_XML_FILE'));

		return;
	}
	$this->fileParameters['SIZE'] = (int)filesize($this->fileParameters['ABSOLUTE_PATH']);
	if ($this->fileParameters['SIZE'] <= 0)
	{
		$this->addError(Loc::getMessage('IBLOCK_XML_IMPORT_ERR_OPEN_XML_FILE'));

		return;
	}
}