• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/import/import.php
  • Класс: BitrixSaleLocationImportis
  • Вызов: is::readBlockFromCurrentFile
protected function readBlockFromCurrentFile(&$buffer, &$bufferSize)
{
	$fIndex = 		$this->data['current']['fIndex'];
	$fName = 		self::getFileNameByIndex($fIndex);
	$onlyThese =& 	$this->data['files'][$fIndex]['onlyThese'];
	$memGroup = 	$this->data['files'][$fIndex]['memgroup'];

	//_dump_r('READ FROM File: '.$fName.' seek to '.$this->data['current']['bytesRead'].' stepsize: '.$this->getCurrStageStepSize());
	//_dump_r('Block size '.$this->getCurrStageStepSize());

	$csv = new CSVReader();
	$block = $csv->ReadBlock(self::LOCAL_PATH.$fName, $this->data['current']['bytesRead'], $this->getCurrStageStepSize());

	if($csv->CheckFileIsLegacy())
		$block = self::convertBlock($block);

	foreach($block as $item)
	{
		if(is_array($onlyThese) && !isset($onlyThese[$item['CODE']]))
			continue;

		$buffer[$memGroup][] = $item;
		$bufferSize++;
	}

	//_dump_r('Bytes read: '.$this->data['current']['bytesRead']);
}