本文整理汇总了PHP中BxDolModuleDb::getDependent方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolModuleDb::getDependent方法的具体用法?PHP BxDolModuleDb::getDependent怎么用?PHP BxDolModuleDb::getDependent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolModuleDb
的用法示例。
在下文中一共展示了BxDolModuleDb::getDependent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
function uninstall($aParams)
{
$oModuleDb = new BxDolModuleDb();
$sTitle = _t('_adm_txt_modules_operation_uninstall', $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_uninstalled'), 'result' => false);
}
//--- Check for dependent modules ---//
$bDependent = false;
$aDependents = $oModuleDb->getDependent($this->_aConfig['home_uri']);
if (is_array($aDependents) && !empty($aDependents)) {
$bDependent = true;
$sMessage = '<br />-- -- ' . _t('_adm_txt_modules_has_dependents') . '<br />';
foreach ($aDependents as $aDependent) {
$sMessage .= '-- -- ' . $aDependent['title'] . '<br />';
}
}
if ($bDependent) {
return array('operation_title' => $sTitle, 'message' => $this->_displayResult('check_dependencies', false, $sMessage), 'result' => false);
}
$aResult = $this->_perform('uninstall', 'Uninstallation');
if ($aResult['result']) {
$iModuleId = (int) $oModuleDb->getOne("SELECT `id` FROM `sys_modules` WHERE `vendor`='" . $this->_aConfig['vendor'] . "' AND `path`='" . $this->_aConfig['home_dir'] . "' LIMIT 1");
$oModuleDb->query("DELETE FROM `sys_modules` WHERE `vendor`='" . $this->_aConfig['vendor'] . "' AND `path`='" . $this->_aConfig['home_dir'] . "' LIMIT 1");
$oModuleDb->query("DELETE FROM `sys_modules_file_tracks` WHERE `module_id`='" . $iModuleId . "'");
$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;
}