コード例 #1
0
 public function import($db_already_cloned)
 {
     General::setProgressTitle(__CLASS__);
     if (!$db_already_cloned) {
         if (!General::cloneImportedDB($this->store_data)) {
             return false;
         }
     } else {
         General::setEmptyProgressBar(__('importing_data'));
         General::setEmptyProgressBar(__('importing_data'));
     }
     General::connectToOriginalDB(array('table_prefix' => General::formatPrefix()));
     $skin_name = $this->_getSkinName();
     $default_company = General::getDefaultCompany();
     General::processAddons($this->store_data, __CLASS__);
     $this->_processCurrencies();
     $this->_processLanguages();
     $main_sql = Registry::get('config.dir.addons') . 'store_import/database/' . $this->main_sql_filename;
     if (is_file($main_sql)) {
         //Process main sql
         if (!db_import_sql_file($main_sql)) {
             return false;
         }
     }
     General::uninstallAddons(array('twigmo', 'searchanise', 'live_help', 'exim_store', 'webmail'));
     $default_company_id = (int) General::createDefaultCompany($default_company);
     $this->_updateCompanyId($default_company_id);
     $this->_processPayments();
     $this->_processBMContainers();
     $this->_createLayouts();
     $this->_convertOrders($default_company_id);
     $this->_processImages($skin_name);
     $this->_processFiles('downloads');
     $this->_processFiles('attachments');
     $this->_processFiles('custom_files');
     $this->_processLanguageValues();
     $this->_processProducts($default_company_id);
     $this->_processShippings($default_company_id);
     General::updateStatusColors();
     General::processBMBlocksTemplates();
     General::processBMProductFiltersBlockContent();
     General::setEmptyProgressBar(General::getUnavailableLangVar('updating_languages'));
     General::updateAltLanguages('language_values', 'name');
     General::updateAltLanguages('settings_descriptions', array('object_id', 'object_type'));
     General::updateAltLanguages('shipping_service_descriptions', 'service_id');
     General::updateAltLanguages('privilege_descriptions', 'privilege');
     General::updateAltLanguages('privilege_section_descriptions', 'section_id');
     General::updateAltLanguages('state_descriptions', 'state_id');
     General::updateAltLanguages('country_descriptions', 'code');
     General::updateAltLanguages('bm_blocks_descriptions', 'block_id');
     General::updateAltLanguages('bm_locations_descriptions', 'location_id');
     General::updateAltLanguages('bm_blocks_content', array('snapping_id', 'object_id', 'object_type', 'block_id'));
     return true;
 }
コード例 #2
0
ファイル: F306Tult.php プロジェクト: heg-arc-ne/cscart
 public function import($db_already_cloned)
 {
     Registry::set('runtime.simple_ultimate', true);
     Registry::del('runtime.forced_company_id');
     General::setProgressTitle(__CLASS__);
     if (!$db_already_cloned) {
         if (!General::cloneImportedDB($this->store_data)) {
             return false;
         }
     } else {
         General::setEmptyProgressBar(__('importing_data'));
         General::setEmptyProgressBar(__('importing_data'));
     }
     General::connectToOriginalDB(array('table_prefix' => General::formatPrefix()));
     $default_company = General::getDefaultCompany();
     $supplier_settings = $this->getSupplierSettings();
     General::setSupplierSettings($supplier_settings);
     $enabledSuppliers = General::supplierSettings('enabled') ? true : false;
     $main_sql = Registry::get('config.dir.addons') . 'store_import/database/' . $this->main_sql_filename;
     if (is_file($main_sql)) {
         //Process main sql
         if (!db_import_sql_file($main_sql)) {
             return false;
         }
     }
     if ($enabledSuppliers) {
         $this->_importSuppliers();
     }
     General::processAddons($this->store_data, __CLASS__);
     General::setEmptyProgressBar();
     $this->_deleteAllCompanies();
     $default_company_id = (int) General::createDefaultCompany($default_company);
     $this->_fillSharingTable($default_company_id);
     $this->_updateCompanyId($default_company_id);
     $this->_setStorefromUrl($default_company_id, $this->store_data);
     General::setEmptyProgressBar();
     return true;
 }