* @copyright 2015 PrestaShow.pl * @license http://PrestaShow.pl/license */ // not finished die('no_access'); ini_set('max_execution_time', 86400); ini_set('display_errors', 'On'); error_reporting(E_ALL); define('IMPORTING_NOW', true); define('_PS_ADMIN_DIR_', true); require_once "./../../config/config.inc.php"; require_once "./config.php"; ini_set('display_errors', 'On'); error_reporting(E_ALL); if (!Tools::getValue('securekey') || Tools::getValue('securekey') != _IMPORT_SECURE_KEY_) { if (!Tools::getValue('securekey') && (!isset($argv[1]) || $argv[1] != _IMPORT_SECURE_KEY_)) { die('direct access denied'); } } PShow_Import::getInstance(file_get_contents(_IMPORT_STATUS_PATH_ . "filename")); $ajax_import_file = _IMPORT_STATUS_PATH_ . "ajax_import"; if (PShow_Import::getInstance()) { $ajax_import_id = uniqid(); file_put_contents($ajax_import_file, $ajax_import_id); } do { if (!file_exists($ajax_import_file) || !PShow_Import::getInstance() || file_get_contents($ajax_import_file) != $ajax_import_id) { break; } $actual_row = (int) Tools::file_get_contents(_IMPORT_STATUS_PATH_ . "actual_row"); $rows_to_import = PShow_Import::getInstance()->config[0]['rowsCount'] - $actual_row; PShow_Import::getInstance()->importToDatabase(); } while (($rows_to_import - 1) > 0); // disable maintenance mode if ((bool) Configuration::get('pshowimporter_maintenance_mode') && PShow_Import::getInstance()->maintenance_mode_enabled) { PShow_Log::addImportLog("disabled maintenance mode"); Configuration::updateValue('PS_SHOP_ENABLE', '1'); } die('IMPORT FINISHED');