Пример #1
0
 public static function checkIndexesValid()
 {
     if (!Finder::checkIndexValid()) {
         static::showSearchNotification();
     }
     $cnt = static::getCounter();
     if ($cnt > static::HITS_BETWEEN_RECHECKS || !static::checkIndexValid()) {
         $allOk = true;
         $map = ImportProcess::getIndexMap();
         if (is_array($map)) {
             foreach ($map as $ixName => $ixInfo) {
                 if (!$ixInfo['DROP_ONLY'] && !DB\Helper::checkIndexNameExists($ixName, $ixInfo['TABLE'])) {
                     $allOk = false;
                     break;
                 }
             }
         } else {
             $allOk = false;
         }
         if ($allOk) {
             static::setIndexValid();
         } else {
             static::setIndexInvalid();
         }
         static::setCounter(0);
     } else {
         static::setCounter($cnt + 1);
     }
     if (!static::checkIndexValid()) {
         static::showDBIndexNotification();
     }
 }
Пример #2
0
<?php

use Bitrix\Main;
use Bitrix\Main\Localization\Loc;
use Bitrix\Sale\Location\Admin\Helper;
define("NO_AGENT_CHECK", true);
define("NO_KEEP_STATISTIC", true);
$initialTime = time();
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
Loc::loadMessages(__FILE__);
$APPLICATION->SetTitle(Loc::getMessage('SALE_LOCATION_IMPORT_TITLE'));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
// check for indexes
$indexes = \Bitrix\Sale\Location\Import\ImportProcess::getIndexMap();
$absent = array();
if (is_array($indexes) && !empty($indexes)) {
    foreach ($indexes as $name => $params) {
        if ((string) $params['TABLE'] != '' && !$params['DROP_ONLY']) {
            if (!\Bitrix\Sale\Location\DB\Helper::checkIndexNameExists($name, $params['TABLE'])) {
                $absent[] = 'create index ' . $name . ' on ' . $params['TABLE'] . ' (' . implode(', ', $params['COLUMNS']) . ')' . \Bitrix\Sale\Location\DB\Helper::getQuerySeparatorSql();
            }
        }
    }
}
if (!empty($absent)) {
    ?>

	<span style="color: #ff0000">
		<?php 
    echo Loc::getMessage('SALE_LOCATION_IMPORT_NO_INDEXES_WARNING', array('#ANCHOR_SQL_CONSOLE#' => '<a href="/bitrix/admin/sql.php" target="_blank">', '#ANCHOR_END#' => '</a>'));
Пример #3
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();