Exemplo n.º 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'));
     }
     //We should get locations before database upgrade. It is for the old versions.
     $bm_locations = $this->_getBmLocations();
     General::connectToOriginalDB(array('table_prefix' => General::formatPrefix()));
     if (General::supplierSettings('enabled')) {
         $this->_installSuppliers();
     }
     $skin_name = $this->_getSkinName();
     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'));
     //        General::restoreSettings();
     $this->_processPayments();
     $this->_processBMContainers();
     $this->_createLayouts($bm_locations);
     $this->_convertOrders();
     $this->_processImages($skin_name);
     $this->_processFiles('downloads');
     $this->_processFiles('attachments');
     $this->_processFiles('custom_files');
     $this->_processLanguageValues();
     $this->_fillSharingTable();
     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;
 }
Exemplo n.º 2
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()));
     $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;
         }
     }
     $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->_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;
 }