Your IP : 18.191.150.17


Current Path : /home/bitrix/ext_www/dev.ballu.in.ua/local/import/
Upload File :
Current File : /home/bitrix/ext_www/dev.ballu.in.ua/local/import/importRest.php

<?
$optionsRest = array('services');
$optionsRestConfig = array(
    'services' =>  array(
        'url' => 'http://api.rusklimat.ru/v0/ebasc/get/',
        'tokin' => 'WWYzZEd3V29jMXFxMDJweTcvSjJOZz09'
    )
);
/*
if (!(isset($argv[1]) && in_array($argv[1], $optionsRest)))
    die('Need type '.implode(' | ', $optionsRest));
*/
$_SERVER["DOCUMENT_ROOT"] = realpath(dirname(__FILE__)."/../..");
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];

define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS",true);
define("BX_CRONTAB", true);
define('BX_NO_ACCELERATOR_RESET', true);
define('SITE_ID', 's1');

require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
CModule::IncludeModule("iblock");

GlOBAL $DB, $USER;
set_time_limit(0);
/*if ($option == 'downloadSource')
{
    $optionsRest = array();
}
else
{
    $optionsRest = array($option);
}*/

foreach($optionsRest as $type)
{
    /**
     * @var ServicesImport $class
     */
    $class = $type.'Import';
    include $class.'.php';
    $import = $class::getyInstance();
    $import->connect($optionsRestConfig[$type]);

    $import->importGeo();
    $import->loadCategories();
    $import->clearData();
    $import->importItem();
    $import->showMessage();
}