Your IP : 18.224.56.35


Current Path : /home/bitrix/ext_www/dev.easy-comfort.com.ua/import/subscripts/
Upload File :
Current File : /home/bitrix/ext_www/dev.easy-comfort.com.ua/import/subscripts/gate_units.php

<?
// на агентах
/*
if( strpos($_SERVER["PHP_SELF"], "DEV") !== false || strpos($_SERVER["PWD"], "DEV") !== false || $_SERVER["SERVER_NAME"] == "dev.easy-comfort.ru" )
	$_SERVER["DOCUMENT_ROOT"] = "/home/bitrix/DEV/dev.easy-comfort.ru";
else
	$_SERVER["DOCUMENT_ROOT"] = "/home/bitrix/PUB/easy-comfort.ru";

require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");

(new RusklimatExchangeUnits)->runExchange(true);
/*
$_SERVER["DOCUMENT_ROOT"] = __DIR__."/../..";
require $_SERVER["DOCUMENT_ROOT"]."/import/.config.php";
echo "here\n";



// Получение каталога
startTimer("units");
$arUnits = getRest("units");
$Units = formatUnits($arUnits["data"]);
stopTimer("units");
//echol($Units);

$arIBUnits = allElements( $MEASURES_IBLOCK, array("ID","NAME","XML_ID", "ACTIVE","PROPERTY_SHORT_NAME"), "XML_ID");



foreach($Units as $xmlid => $unit){

	$toLoad[$xmlid] = [
		"IBLOCK_ID" => $MEASURES_IBLOCK,
		"NAME" => $unit["NAME"],
		"ACTIVE" => $unit["ACTIVE"],
		"XML_ID" => $unit["XML_ID"],
		"PROPERTY_VALUES" => [
			"NSI_CODE" => $unit["NSI_CODE"],
			"INTERNATIONAL_SHORTNAME" => ((is_array($unit["INTERNATIONAL_SHORTNAME"]))? $unit["INTERNATIONAL_SHORTNAME"]: [$unit["INTERNATIONAL_SHORTNAME"]]),
			"SHORT_NAME" => $unit["SHORT_NAME"],
		]
	];

	if(!empty($arIBUnits[$xmlid])) $toLoad[$xmlid]["ID"] = $arIBUnits[$xmlid]["ID"];

}

//echol($toLoad);


startTimer("load");
$el = new CIBlockElement;
MakeLoadReady($toLoad);
stopTimer("load");


outTimers();

$fd = fopen($_SERVER["DOCUMENT_ROOT"]."/import/my_cron.txt","a"); 
fwrite($fd, "Обращение к gate_units - ".date("d.m.Y H:i")."\r\n"); 
fclose($fd);
*/
?>