• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/import/compiler/compiler.php
  • Класс: BitrixSaleLocationImportCompileris
  • Вызов: is::putToFile
private function putToFile($data, $poolName, $fileSubname)
{
	$dir = $_SERVER['DOCUMENT_ROOT'].$this->workDir.$this->filePools[$poolName]['DIR'];
	if(!file_exists($dir))
		mkdir($dir, 0755, true);

	if(!isset($this->filePoolsp[$poolName][$fileSubname]))
	{
		$fd = $this->filePoolsp[$poolName][$fileSubname] = fopen($dir.$fileSubname.'.csv', 'w');
		$head = implode(';', array_keys($data));
		fputs($fd, $head.PHP_EOL);

		$this->filePoolsp[$poolName][$fileSubname] = $fd;
	}

	fputs($this->filePoolsp[$poolName][$fileSubname], implode(';', $data).PHP_EOL);
}