/** * */ function onAction() { global $application; $request = $application->getInstance('Request'); $instance = $request->getValueByKey('instance'); $log_clear_type = $request->getValueByKey('log_clear_type'); $value = ''; switch ($instance) { case 'cache': CCacheFactory::clearAll(); $value = getMsg("SYS", "MSG_CACHE_CLEARED"); if (APC_EXTENSION_LOADED) { apc_clear_cache("user"); } break; case 'timeline': modApiFunc('Timeline', 'clearTimeline', $log_clear_type); $timeline = modApiFunc('Timeline', 'getTimelineRecsCount'); if ($timeline == 0) { $value = getMsg("SYS", "ADMIN_PHP_FILES_NO_LOG_RECORDS"); } else { $value = $timeline . getMsg("SYS", "ADMIN_PHP_FILES_LOG_RECORDS"); } break; default: break; } return $value; }
function onAction() { global $application; $mm = $application->getInstance('Modules_Manager'); $lang = _ml_strtolower($application->getAppIni('LANGUAGE')); $_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/avactis-themes/system/resources/messages.ini'; modApiFunc("Resources", "dropMessageGroupByMetaId", 'CZ'); modApiFunc("Resources", "dropMessageMetaByMetaId", 'CZ'); modApiFunc("Resources", "addResourceIniToDB", $_path, 'CZ', 'customer_messages', 'CZ'); modApiFunc("Resources", "dropMessageGroupByMetaId", 'SYS'); modApiFunc("Resources", "dropMessageMetaByMetaId", 'SYS'); modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'system-messages-' . $lang . '.ini', 'SYS', 'system_messages', 'AZ'); modApiFunc("Resources", "dropMessageGroupByMetaId", 'ML'); modApiFunc("Resources", "dropMessageMetaByMetaId", 'ML'); modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'multilang-messages-' . $lang . '.ini', 'ML', 'MultiLang', 'AZ'); modApiFunc("Resources", "dropMessageGroupByMetaId", 'CFG'); modApiFunc("Resources", "dropMessageMetaByMetaId", 'CFG'); modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'configuration-messages-' . $lang . '.ini', 'CFG', 'Configuration', 'AZ'); foreach ($mm->moduleList as $module_name => $moduleInfo) { if (isset($mm->modulesResFiles[$moduleInfo->shortName])) { modApiFunc("Resources", "dropMessageGroupByMetaId", $moduleInfo->shortName); modApiFunc("Resources", "dropMessageMetaByMetaId", $moduleInfo->shortName); modApiFunc("Resources", "addResourceIniToDB", $mm->modulesResFiles[$moduleInfo->shortName], $moduleInfo->shortName, $moduleInfo->name, 'AZ'); } } CCacheFactory::clearAll(); die('done'); }
/** * */ function onAction() { global $application; CCacheFactory::clearAll(); modApiFunc("Tools", "clearBackupSession"); modApiFunc("Tools", "setDBStat", modApiFunc("Modules_Manager", "getTablesAndRecordsCount")); modApiFunc("Tools", "setCurrentBackupTable", 0); modApiFunc("Tools", "setCurrentBackupTableLimit", 0); modApiFunc("Tools", "setDBRecordsExported", 0); $request = $application->getInstance('Request'); $filename = $request->getValueByKey('BackupFile'); if ($filename) { modApiFunc("Tools", "setRestoreStatus", 'BACKUP'); modApiFunc("Tools", "setRestoreFile", $filename); $filename = modApiFunc("Tools", "getRestoreFile"); $full_filename = $application->getAppIni('PATH_BACKUP_DIR') . $filename . "/dump.sql"; $handle = @fopen($full_filename, "rb"); $backup_file_content = @fread($handle, 1024); @fclose($handle); $error = ""; $backup_info = @_parse_ini_file($application->getAppIni('PATH_BACKUP_DIR') . $filename . "/info/backup.ini"); if (!isset($backup_info["asc_version"]) || $backup_info["asc_version"] != PRODUCT_VERSION) { $error = "BCP_RESTORE_ERR_003"; } elseif (!$backup_file_content) { $error = "BCP_RESTORE_ERR_001"; } elseif (_ml_strpos($backup_file_content, "-- HASH: ") === false) { $error = "BCP_RESTORE_ERR_002"; } else { $hash = _byte_substr($backup_file_content, 9, 32); // $handle = fopen($full_filename, "rb"); $md5_temp = ''; // $begin = _byte_strpos($backup_file_content, "\n") + _byte_strlen("\n"); fseek($handle, $begin); while (!feof($handle)) { $contents = fread($handle, 1048576); $md5_temp .= md5($contents); } $counted_file_hash = md5($md5_temp); fclose($handle); // : if ($hash != $counted_file_hash) { $error = "BCP_RESTORE_ERR_002"; } } if ($error) { modApiFunc("Tools", "setRestoreError", $error); } else { modApiFunc("Tools", "setStringsCountInRestoreFile", $filename); } } modApiFunc("Tools", "saveState"); }
/** * */ function onAction() { global $application; $request = $application->getInstance('Request'); $AutoBackup = $request->getValueByKey('AutoBackup'); if ($AutoBackup) { CCacheFactory::clearAll(); modApiFunc("Session", "set", "AutoBackup", true); } else { modApiFunc("Session", "un_set", "AutoBackup"); } }
function onAction() { global $application; $request =& $application->getInstance('Request'); $moduleName = $request->getValueByKey('module_name'); if (!empty($moduleName)) { $moduleInfo = modApiFunc('Modules_Manager', 'getModuleInfoByName', $moduleName); modApiFunc('Modules_Manager', 'uninstallModule', $moduleInfo); CCacheFactory::clearAll(); } $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $application->redirect($request); }
/** * */ function onAction() { global $application; $getRebuildVal = $application->getInstance('Request'); $rebuildval = $getRebuildVal->getValueByKey('rebuildval'); if ($rebuildval == 'yes') { $lang = _ml_strtolower($application->getAppIni('LANGUAGE')); modApiFunc('Resources', 'deleteSYSLabels', 'SYS'); modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'system-messages-' . $lang . '.ini', 'SYS', 'system_messages', 'AZ'); modApiFunc('Session', 'set', 'ResultMessage', 'MSG_CACHE_UPDATED'); } else { CCacheFactory::clearAll(); $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $application->redirect($request); modApiFunc('Session', 'set', 'ResultMessage', 'MSG_CACHE_UPDATED'); } }
function onAction() { global $application; $request = $_POST; $_state = modApiFunc("License", "checkLicense"); $licenseInfo = modApiFunc("License", "getLicenseInfo", $_state); if (class_exists('ZipArchive')) { $this->marketplace_server = $application->getAppIni('MARKETPLACE_SERVER'); $data = array('license' => $licenseInfo["license_key"], 'store_url' => $_SERVER['HTTP_HOST'] . $_SERVER['CONTEXT_PREFIX'], 'store_version' => PRODUCT_VERSION_NUMBER); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('POST'); $bnc->setPOSTstring($bnc->prepareDATAstring($data)); $bnc->setURL($this->marketplace_server . "/download_extension.php?asc_action=SendLatestCoreFile"); $bnc->setProto('HTTPS'); $result = $bnc->RunRequest(); $response = $result['body']; if ($response != false && $bnc->responseCode < 400) { if (strpos($response, "ERR_") === 0) { modApiFunc("Session", "set", "ErrorMessage", $response); } else { $file = fopen($application->getAppIni('PATH_CACHE_DIR') . "avactis-upgrade.zip", 'w+'); fwrite($file, $response); fclose($file); $core_response = modApiFunc("Extension_Manager", "upgradeCore"); if (strpos($core_response, "ERR_") === 0) { modApiFunc("Session", "set", "ErrorMessage", $core_response); } else { CCacheFactory::clearAll(); $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $application->redirect($request); } } } else { $error = "ERR_MARKETPLACE_NOT_AVAILABLE"; modApiFunc("Session", "set", "ErrorMessage", $error); } } else { $error = "ERR_CHK_ZIP_OR_PERMISSIONS"; modApiFunc("Session", "set", "ErrorMessage", $error); } }
function onAction() { global $application; $request = $_POST; $extension_name = $request["extn_name"]; $_state = modApiFunc("License", "checkLicense"); $licenseInfo = modApiFunc("License", "getLicenseInfo", $_state); $data = array('license' => $licenseInfo["license_key"], 'store_url' => $_SERVER['HTTP_HOST'] . $_SERVER['CONTEXT_PREFIX'], 'extn_name' => $extension_name, 'store_version' => PRODUCT_VERSION_NUMBER); $marketplace_server = $application->getAppIni('MARKETPLACE_SERVER'); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('POST'); $bnc->setPOSTstring($bnc->prepareDATAstring($data)); $bnc->setURL($marketplace_server . "/download_extension.php?asc_action=SendExtension"); $bnc->setProto('HTTPS'); $result = $bnc->RunRequest(); $response = $result['body']; if ($response != false && $bnc->responseCode < 400) { if (strpos($response, "ERR_") === 0) { modApiFunc("Session", "set", "ErrorMessage", $response); //return $response['err_msg']; } else { $file = fopen($application->getAppIni(PATH_CACHE_DIR) . $extension_name . ".zip", 'w+'); fwrite($file, $response); fclose($file); $installed = modApiFunc("Extension_Manager", "installExtension", $extension_name); if ($installed) { modApiFunc("Session", "set", "InstallMessage", "1"); CCacheFactory::clearAll(); $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $request->setKey('identifier', 'ExtensionManager_ListView'); $application->redirect($request); } else { modApiFunc("Session", "set", "ErrorMessage", "ERR_CHK_ZIP_OR_PERMISSIONS"); } } } else { modApiFunc("Session", "set", "ErrorMessage", "ERR_MARKETPLACE_NOT_AVAILABLE"); } }
function onAction() { global $application; $request =& $application->getInstance('Request'); $pi_target = $request->getValueByKey('pi_target'); global $_RESULT; switch ($pi_target) { case 'init': /* $sets['script_code'] = 'Products_CSV_DB'; $sets['script_step'] = $request->getValueByKey('script_step'); $sets['src_file'] = $request->getValueByKey('src_file'); $sets['csv_delimiter'] = $this->CSV_DELIMITERS[$request->getValueByKey('csv_delimiter')]; $sets['target_ptype'] = $request->getValueByKey('target_ptype'); $sets['target_category'] = $request->getValueByKey('target_category'); $sets['cache_dir'] = $application->getAppIni('PATH_CACHE_DIR').'_import_cache/'; $sets['src_images_dir'] = $request->getValueByKey('src_images_dir'); $sets['autoclear'] = $request->getValueByKey('autoclear')=='Y' ? true : false;*/ CCacheFactory::clearAll(); $sets = array('script_code' => 'Products_CSV_DB', 'script_step' => $request->getValueByKey('script_step'), 'cache_dir' => $application->getAppIni('PATH_CACHE_DIR') . '_import_cache/'); if ($sets['script_step'] == 1) { $sets = array_merge($sets, array('src_file' => $request->getValueByKey('src_file'), 'header_rx' => "/^Product[A-Za-z0-9_]+\$/")); } if ($sets['script_step'] == 2) { $sets = array_merge($sets, array('target_ptype' => $request->getValueByKey('target_ptype'), 'target_category' => $request->getValueByKey('target_category'), 'src_images_dir' => $request->getValueByKey('src_images_dir'), 'src_images_tar' => $request->getValueByKey('src_images_tar'), 'autoclear' => true)); } modApiFunc('Data_Converter', 'initDataConvert', $sets); $_RESULT["errors"] = modApiFunc('Data_Converter', 'getErrors'); $_RESULT["warnings"] = modApiFunc('Data_Converter', 'getWarnings'); $_RESULT["messages"] = modApiFunc('Data_Converter', 'getMessages'); $_RESULT["process_info"] = modApiFunc('Data_Converter', 'getProcessInfo'); break; case 'do': modApiFunc('Data_Converter', 'doDataConvert'); $_RESULT["errors"] = modApiFunc('Data_Converter', 'getErrors'); $_RESULT["warnings"] = modApiFunc('Data_Converter', 'getWarnings'); $_RESULT["messages"] = modApiFunc('Data_Converter', 'getMessages'); $_RESULT["process_info"] = modApiFunc('Data_Converter', 'getProcessInfo'); break; } }
function onAction() { global $application; $request =& $application->getInstance('Request'); $il_target = $request->getValueByKey('il_target'); global $_RESULT; switch ($il_target) { case 'init': // clearing cache CCacheFactory::clearAll(); // : here will come checking if the file is csv or xliff // for now: assuming it is a csv file $sets = array('script_code' => 'Labels_CSV_DB', 'script_step' => $request->getValueByKey('script_step'), 'cache_dir' => $application->getAppIni('PATH_CACHE_DIR') . '_import_cache/'); if ($sets['script_step'] == 1) { $sets['src_file'] = $request->getValueByKey('src_file'); } if ($sets['script_step'] == 2) { $sets['filter'] = array('tt' => array('found' => $request->getValueByKey('tt_found'), 'new' => $request->getValueByKey('tt_new')), 'lang' => array('found' => explode('|', $request->getValueByKey('l_found')), 'new' => explode('|', $request->getValueByKey('l_new'))), 'type' => array('found' => explode('|', $request->getValueByKey('t_found')), 'new' => explode('|', $request->getValueByKey('t_new')))); $sets['autoclear'] = true; $sets['def_lng'] = modApiFunc('MultiLang', 'getDefaultLanguage'); } modApiFunc('Data_Converter', 'initDataConvert', $sets); $_RESULT["errors"] = modApiFunc('Data_Converter', 'getErrors'); $_RESULT["warnings"] = modApiFunc('Data_Converter', 'getWarnings'); $_RESULT["messages"] = modApiFunc('Data_Converter', 'getMessages'); $_RESULT["process_info"] = modApiFunc('Data_Converter', 'getProcessInfo'); break; case 'do': modApiFunc('Data_Converter', 'doDataConvert'); $_RESULT["errors"] = modApiFunc('Data_Converter', 'getErrors'); $_RESULT["warnings"] = modApiFunc('Data_Converter', 'getWarnings'); $_RESULT["messages"] = modApiFunc('Data_Converter', 'getMessages'); $_RESULT["process_info"] = modApiFunc('Data_Converter', 'getProcessInfo'); break; } }
function updateExtensionStatus($extensionName, $status) { execQuery('UPDATE_EXTENSION_STATUS', array('name' => $extensionName, 'active' => $status)); CCacheFactory::clearAll(); }
/** * */ function onAction() { CCacheFactory::clearAll(); modApiFunc("Tools", "RestoreBackup"); }
/** * * * @return null */ function initModules() { global $application, $zone; $lang = _ml_strtolower($application->getAppIni('LANGUAGE')); $moduleListCache = $application->getMMCache(); if (isset($_SERVER['QUERY_STRING']) and $_SERVER['QUERY_STRING'] == 'update_all_modules') { CCacheFactory::clearAll(); $this->resetAllModulesStatus(); $_die_after_init = true; } else { $_die_after_init = false; } if (!$this->isModuleInstalled('Modules_Manager')) { $this->installModule($this->getModuleInfoFromFile($this->modules_directory . 'Modules_Manager')); CCacheFactory::clearAll(); } else { /* Upgrade Main Store SQL- start*/ $mmInfo = $this->getModuleInfoFromFile($this->modules_directory . 'Modules_Manager'); if (version_compare($this->getModuleVersion($mmInfo->name), $mmInfo->version) < 0) { $oldVersionexplode = explode(".", $this->getModuleVersion($mmInfo->name)); $oldModuleVersion = $oldVersionexplode[2]; $upgradeFolder = $application->appIni['PATH_SYSTEM_DIR'] . "dbupdates/"; $this->executeUpgradeSQL($oldModuleVersion, $upgradeFolder); } /* Upgrade Main Store SQL-end */ } if (!$this->isModuleInstalled('Resources')) { $this->installModule($this->getModuleInfoFromFile($this->modules_directory . 'Resources')); // aquire system and CZ messages modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'system-messages-' . $lang . '.ini', 'SYS', 'system_messages', 'AZ'); $_path = dirname(dirname(dirname(dirname(__FILE__)))) . '/avactis-themes/system/resources/messages.ini'; modApiFunc("Resources", "addResourceIniToDB", $_path, 'CZ', 'customer_messages', 'CZ'); CCacheFactory::clearAll(); } if (!$this->isModuleInstalled('MultiLang')) { modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'multilang-messages-' . $lang . '.ini', 'ML', 'MultiLang', 'AZ'); $this->installModule($this->getModuleInfoFromFile($this->modules_directory . 'multilang')); $this->isModuleInstalled('MultiLang', true); // , CCacheFactory::clearAll(); } if (!$this->isModuleInstalled('Configuration')) { modApiFunc("Resources", "addResourceIniToDB", $application->getAppIni('PATH_ADMIN_RESOURCES') . 'configuration-messages-' . $lang . '.ini', 'CFG', 'Configuration', 'AZ'); $this->installModule($this->getModuleInfoFromFile($this->modules_directory . 'configuration')); $this->isModuleInstalled('Configuration', true); // , CCacheFactory::clearAll(); } if (!$this->isModuleInstalled('EventsManager')) { $this->installModule($this->getModuleInfoFromFile($this->modules_directory . 'eventsmanager')); $this->isModuleInstalled('EventsManager', true); // , CCacheFactory::clearAll(); } if ($application->db->DB_isTableExists($application->getAppIni('DB_TABLE_PREFIX') . "sessions") == false) { $tables['sessions'] = array(); $tables['sessions']['columns'] = array('ses_id' => 'sessions.ses_id', 'ses_time' => 'sessions.ses_time', 'ses_value' => 'sessions.ses_value', 'ses_locked' => 'sessions.ses_locked'); $tables['sessions']['types'] = array('ses_id' => DBQUERY_FIELD_TYPE_CHAR32 . ' NOT NULL DEFAULT \'\'', 'ses_time' => DBQUERY_FIELD_TYPE_INT . ' NOT NULL DEFAULT 0', 'ses_value' => DBQUERY_FIELD_TYPE_LONGTEXT . ' NOT NULL ', 'ses_locked' => DBQUERY_FIELD_TYPE_INT . ' NOT NULL DEFAULT 0'); $tables['sessions']['primary'] = array('ses_id'); $tables['sessions']['indexes'] = array('IDX_time' => 'ses_time', 'IDX_locked' => 'ses_locked'); $query = new DB_Table_Create($application->addTablePrefix($tables)); } $this->moduleList = $moduleListCache->read('ModulesList'); $this->apiFiles = $moduleListCache->read('apiFiles'); $this->modulesResFiles = $moduleListCache->read('modulesResFiles'); $this->shortNamesToResFiles = $moduleListCache->read('shortNamesToResFiles'); $this->actionList = $moduleListCache->read('actionList'); $this->czViewList = $moduleListCache->read('czViewList'); $this->azViewList = $moduleListCache->read('azViewList'); $this->czAliasesList = $moduleListCache->read('czAliasesList'); $this->hookList = $moduleListCache->read('hookList'); $this->blocksList = $moduleListCache->read('blocksList'); $this->SectionByView = $moduleListCache->read('SectionByView'); $this->ViewBySection = $moduleListCache->read('ViewBySection'); $this->storefrontLayout = $moduleListCache->read('storefrontLayout'); if (!$this->hookList) { $this->hookList = array(); } if (!isset($this->moduleList)) { $this->moduleList = array(); /** installed Extensions Array **/ $installedExtensionArray = $this->getInstalledExtensionModuleInfo(); /* Processing for avactis-extensions directory-Begin*/ $dir = @dir($application->getAppIni("PATH_ADD_MODULES_DIR")); if (is_dir($application->getAppIni("PATH_ADD_MODULES_DIR")) && is_readable($application->getAppIni("PATH_ADD_MODULES_DIR"))) { while ($file = $dir->read()) { if ($file != '..' && $file != '.' && is_dir($application->getAppIni("PATH_ADD_MODULES_DIR") . $file)) { $moduleInfo = $this->getModuleInfoFromFile($this->add_modules_directory . $file); $isExtensionNotInstalled = true; if (isset($installedExtensionArray[$moduleInfo->name])) { $isExtensionNotInstalled = $installedExtensionArray[$moduleInfo->name]['module_active']; } if ($isExtensionNotInstalled && $moduleInfo != null) { $this->moduleList[$moduleInfo->name] = $moduleInfo; } } } } /* Processing for avactis-extensions directory-End*/ $dir = @dir($application->getAppIni("PATH_MODULES_DIR")); while ($file = $dir->read()) { if ($file != '..' && $file != '.' && !is_dir($application->getAppIni("PATH_ADD_MODULES_DIR") . $file) && is_dir($application->getAppIni("PATH_MODULES_DIR") . $file)) { $moduleInfo = $this->getModuleInfoFromFile($this->modules_directory . $file); if ($moduleInfo != null) { // $this->moduleList[$moduleInfo->name] = $moduleInfo; } } } asort($this->moduleList); foreach ($this->moduleList as $module_name => $moduleInfo) { // check if the files of the module exist. $this->checkModuleFiles($moduleInfo); // save the class name of the module and the whole path to its main file in the list $this->apiFiles[_ml_strtolower($moduleInfo->name)] = $moduleInfo->mainFile; // save all extra API classes and their files if (is_array($moduleInfo->extraAPIFiles)) { foreach ($moduleInfo->extraAPIFiles as $class => $file) { $this->apiFiles[_ml_strtolower($class)] = $file; } } if ($moduleInfo->shortName != null and isset($this->modulesResFiles[$moduleInfo->shortName])) { unset($this->moduleList[$moduleInfo->name]); CTrace::err('Duplicate Short Name ' . $moduleInfo->shortName); continue; } $res_file_suffix = '-' . _ml_strtolower($application->getAppIni('LANGUAGE')) . '.ini'; $res_files_common_location = $application->getAppIni('PATH_ADMIN_RESOURCES'); if ($moduleInfo->resFile != null and $moduleInfo->shortName != null) { /* * $this->modulesResFiles * . . */ $res_file_in_module = $this->store_dir . $moduleInfo->directory . 'resources/' . $moduleInfo->resFile . $res_file_suffix; $res_file_in_common_location = $res_files_common_location . $moduleInfo->resFile . $res_file_suffix; if ($moduleInfo->shortName == null) { _fatal("Module {$moduleInfo->name} has no short name."); } if (isset($this->shortNamesToResFiles[$moduleInfo->resFile])) { _fatal("Duplicate Res File for {$moduleInfo->name}."); } else { $this->shortNamesToResFiles[$moduleInfo->resFile] = $moduleInfo->shortName; } if (file_exists($res_file_in_module)) { $this->modulesResFiles[$moduleInfo->shortName] = $res_file_in_module; } else { if (file_exists($res_file_in_common_location)) { $this->modulesResFiles[$moduleInfo->shortName] = $res_file_in_common_location; } } } // API . // . if (PRODUCT_VERSION_TYPE == 'TRUNK') { $this->checkModuleAPIClass($moduleInfo); } // , // , . // get text resources from the res file and put it into the database if (!$this->isModuleInstalled($moduleInfo->name)) { if (!isset($moduleInfo->shortName)) { _fatal("No short name for {$moduleInfo->name}!"); } if (isset($this->modulesResFiles[$moduleInfo->shortName]) && file_exists($this->modulesResFiles[$moduleInfo->shortName])) { modApiFunc("Resources", "dropMessageMetaByMetaId", $moduleInfo->shortName); modApiFunc("Resources", "dropMessageGroupByMetaId", $moduleInfo->shortName); modApiFunc("Resources", "addResourceIniToDB", $this->modulesResFiles[$moduleInfo->shortName], $moduleInfo->shortName, $moduleInfo->name, 'AZ'); } else { // no res file for module } } $this->installModule($moduleInfo); // update , // , modules updated . $this->updateModule($moduleInfo); // actions foreach ($moduleInfo->actionFiles as $actionName => $actionFile) { $this->actionList[$actionName] = $actionFile; } // save the list of all views for CustomerZone foreach ($moduleInfo->czViewFiles as $viewName => $viewFile) { $this->czViewList[$viewName] = $viewFile; } // save the list of all views for AdminZone foreach ($moduleInfo->czAliases as $alias => $viewName) { $this->czAliasesList[$alias] = $viewName; } // save the list of all views for AdminZone foreach ($moduleInfo->azViewFiles as $viewName => $viewFile) { $this->azViewList[$viewName] = $viewFile; } // save a list of all hooks foreach ($moduleInfo->hookMap as $hookName => $actionList) { foreach ($actionList as $actionName) { if (!key_exists($actionName, $this->hookList)) { $this->hookList[$actionName] = array(); } $this->hookList[$actionName][$hookName] = $moduleInfo->hookFiles[$hookName]; } } // save a list of blocks if (file_exists($this->store_dir . $moduleInfo->directory . 'blocks.yml')) { $this->blocksList[] = $this->store_dir . $moduleInfo->directory . 'blocks.yml'; } // sections by view if (!empty($moduleInfo->SectionByView)) { $this->SectionByView = $moduleInfo->SectionByView; } // views by section if (!empty($moduleInfo->ViewBySection)) { $this->ViewBySection = $moduleInfo->ViewBySection; } // storefront Layout addition if ($moduleInfo->storefrontLayout && file_exists($this->store_dir . $moduleInfo->directory . $moduleInfo->storefrontLayout)) { if (!$this->storefrontLayout) { $this->storefrontLayout = array(); } $this->storefrontLayout = array_merge($this->storefrontLayout, _parse_ini_file($this->store_dir . $moduleInfo->directory . $moduleInfo->storefrontLayout, true)); } } if (PRODUCT_VERSION_TYPE != 'TRUNK') { $moduleListCache->write('ModulesList', $this->moduleList); $moduleListCache->write('apiFiles', $this->apiFiles); $moduleListCache->write('modulesResFiles', $this->modulesResFiles); $moduleListCache->write('shortNamesToResFiles', $this->shortNamesToResFiles); $moduleListCache->write('actionList', $this->actionList); $moduleListCache->write('czViewList', $this->czViewList); $moduleListCache->write('azViewList', $this->azViewList); $moduleListCache->write('czAliasesList', $this->czAliasesList); $moduleListCache->write('hookList', $this->hookList); $moduleListCache->write('blocksList', $this->blocksList); $moduleListCache->write('SectionByView', $this->SectionByView); $moduleListCache->write('ViewBySection', $this->ViewBySection); $moduleListCache->write('storefrontLayout', $this->storefrontLayout); } } else { CTrace::inf('Bypass loading of module list (use cached).'); } if (!defined('COMPILED_MODULES_LOADED')) { foreach ($this->moduleList as $module_name => $moduleInfo) { // if the file of module constants is specfifed, then load it. if ($moduleInfo->constantsFile !== null) { $this->includeFile($moduleInfo->constantsFile); } // load common db queries $common_db_queries_file = $moduleInfo->directory . 'dbqueries/common.php'; if (file_exists($this->store_dir . $common_db_queries_file)) { $this->includeFile($common_db_queries_file); } //load extension default hooks if ($moduleInfo->ext_def_hooks !== null) { $this->includeFile($moduleInfo->ext_def_hooks); } $this->includeFile($moduleInfo->directory . '/asc-hooks.php'); } } else { CTrace::inf('Bypass constants and queries including (use precompiled).'); } if (!defined('MODULES_VIEWS_REGISTERED')) { if ($zone == 'CustomerZone') { foreach ($this->moduleList as $module_name => $moduleInfo) { $this->registerViewList($moduleInfo->czViewFiles); $this->registerAliasesList($moduleInfo->czAliases); } } else { foreach ($this->moduleList as $module_name => $moduleInfo) { $this->registerViewList($moduleInfo->azViewFiles); } } } else { CTrace::inf('Bypass modules views registering (use precompiled).'); } if ($_die_after_init === true) { die('Message'); } }