當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BxDolModuleDb::isModuleParamsUsed方法代碼示例

本文整理匯總了PHP中BxDolModuleDb::isModuleParamsUsed方法的典型用法代碼示例。如果您正苦於以下問題:PHP BxDolModuleDb::isModuleParamsUsed方法的具體用法?PHP BxDolModuleDb::isModuleParamsUsed怎麽用?PHP BxDolModuleDb::isModuleParamsUsed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BxDolModuleDb的用法示例。


在下文中一共展示了BxDolModuleDb::isModuleParamsUsed方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: install

 function install($aParams)
 {
     $oModuleDb = new BxDolModuleDb();
     $sTitle = _t('_adm_txt_modules_operation_install', $this->_aConfig['title']);
     //--- Check whether the module was already installed ---//
     if ($oModuleDb->isModule($this->_aConfig['home_uri'])) {
         return array('operation_title' => $sTitle, 'message' => _t('_adm_txt_modules_already_installed'), 'result' => false);
     }
     //--- Check mandatory settings ---//
     if ($oModuleDb->isModuleParamsUsed($this->_aConfig['home_uri'], $this->_aConfig['home_dir'], $this->_aConfig['db_prefix'], $this->_aConfig['class_prefix'])) {
         return array('operation_title' => $sTitle, 'message' => _t('_adm_txt_modules_params_used'), 'result' => false);
     }
     //--- Check version compatibility ---//
     $bCompatible = false;
     if (isset($this->_aConfig['compatible_with']) && is_array($this->_aConfig['compatible_with'])) {
         foreach ($this->_aConfig['compatible_with'] as $iKey => $sVersion) {
             $sVersion = '/^' . str_replace(array('.', 'x'), array('\\.', '[0-9]+'), $sVersion) . '$/is';
             $bCompatible = $bCompatible || preg_match($sVersion, $GLOBALS['site']['ver'] . '.' . $GLOBALS['site']['build']) > 0;
         }
     }
     if (!$bCompatible) {
         return array('operation_title' => $sTitle, 'message' => $this->_displayResult('check_script_version', false, '_adm_txt_modules_wrong_version_script'), 'result' => false);
     }
     //--- Check actions ---//
     $aResult = $this->_perform('install', 'Installation');
     if ($aResult['result']) {
         $sDependencies = "";
         if (isset($this->_aConfig['install']['check_dependencies']) && (int) $this->_aConfig['install']['check_dependencies'] == 1 && isset($this->_aConfig['dependencies']) && is_array($this->_aConfig['dependencies'])) {
             $sDependencies = implode(',', array_keys($this->_aConfig['dependencies']));
         }
         db_res("INSERT IGNORE INTO `sys_modules`(`title`, `vendor`, `version`, `update_url`, `path`, `uri`, `class_prefix`, `db_prefix`, `dependencies`, `date`) VALUES ('" . $this->_aConfig['title'] . "', '" . $this->_aConfig['vendor'] . "', '" . $this->_aConfig['version'] . "', '" . $this->_aConfig['update_url'] . "', '" . $this->_aConfig['home_dir'] . "', '" . $this->_aConfig['home_uri'] . "', '" . $this->_aConfig['class_prefix'] . "', '" . $this->_aConfig['db_prefix'] . "', '" . $sDependencies . "', UNIX_TIMESTAMP())");
         $iModuleId = (int) db_last_id();
         $aFiles = array();
         $this->_hash($this->_sModulePath, $aFiles);
         foreach ($aFiles as $aFile) {
             db_res("INSERT IGNORE INTO `sys_modules_file_tracks`(`module_id`, `file`, `hash`) VALUES('" . $iModuleId . "', '" . $aFile['file'] . "', '" . $aFile['hash'] . "')");
         }
         $GLOBALS['MySQL']->cleanMemory('sys_modules_' . $this->_aConfig['home_uri']);
         $GLOBALS['MySQL']->cleanMemory('sys_modules_' . $iModuleId);
         $GLOBALS['MySQL']->cleanMemory('sys_modules');
     }
     $aResult['operation_title'] = $sTitle;
     return $aResult;
 }
開發者ID:Gotgot59,項目名稱:dolphin.pro,代碼行數:44,代碼來源:BxDolInstaller.php


注:本文中的BxDolModuleDb::isModuleParamsUsed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。