Пример #1
0
    $bRus = true;
}
if ($bRus || COption::GetOptionString("eshop", "wizard_installed", "N", WIZARD_SITE_ID) != "Y" || WIZARD_INSTALL_DEMO_DATA) {
    $loc_file = $wizard->GetVar("locations_csv");
    if (strlen($loc_file) > 0) {
        define('LOC_STEP_LENGTH', 20);
        if (\Bitrix\Main\Config\Option::get('sale', 'sale_locationpro_migrated', '') == 'Y') {
            require $_SERVER['DOCUMENT_ROOT'] . WIZARD_SERVICE_RELATIVE_PATH . "/locations/pro/file_map.php";
            $file_url = $_SERVER['DOCUMENT_ROOT'] . WIZARD_SERVICE_RELATIVE_PATH . "/locations/pro/bundles/" . $LOCATION_FILE_MAP[$loc_file];
            $type_file_url = $_SERVER['DOCUMENT_ROOT'] . WIZARD_SERVICE_RELATIVE_PATH . "/locations/pro/type.csv";
            $service_file_url = $_SERVER['DOCUMENT_ROOT'] . WIZARD_SERVICE_RELATIVE_PATH . "/locations/pro/externalservice.csv";
            if (isset($LOCATION_FILE_MAP[$loc_file]) && file_exists($file_url)) {
                if (!isset($_SESSION["LOC_IMPORT_DESC"]) || $file_url != $_SESSION["LOC_IMPORT_DESC"]['FILE']) {
                    $_SESSION["LOC_IMPORT_DESC"] = array('POS' => 0, 'FILE' => $file_url, 'TYPE_FILE' => $type_file_url, 'SERVICE_FILE' => $service_file_url, 'TIME_LIMIT' => LOC_STEP_LENGTH, 'STEP' => 'import');
                }
                $done = \Bitrix\Sale\Location\Import\ImportProcess::importFile($_SESSION["LOC_IMPORT_DESC"]);
                if ($done) {
                    unset($_SESSION["LOC_IMPORT_DESC"]);
                    // go farther to other steps
                } else {
                    $this->repeatCurrentService = true;
                    // go to the next iteration of the same step
                }
            }
        } else {
            // DEPRECATED old location branch
            $time_limit = ini_get('max_execution_time');
            if ($time_limit < LOC_STEP_LENGTH) {
                set_time_limit(LOC_STEP_LENGTH + 5);
            }
            $start_time = time();