本文整理匯總了PHP中CModule::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP CModule::load方法的具體用法?PHP CModule::load怎麽用?PHP CModule::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CModule
的用法示例。
在下文中一共展示了CModule::load方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dPgetParam
<?php
/* SYSTEM $Id: domodsql.php,v 1.11 2005/03/23 00:30:24 ajdonnison Exp $ */
##
## Activate or move a module entry
##
$cmd = dPgetParam($_GET, 'cmd', '0');
$mod_id = intval(dPgetParam($_GET, 'mod_id', '0'));
$mod_directory = dPgetParam($_GET, 'mod_directory', '0');
$obj = new CModule();
if ($mod_id) {
$obj->load($mod_id);
} else {
$obj->mod_directory = $mod_directory;
}
$ok = @(include_once "{$dPconfig['root_dir']}/modules/{$obj->mod_directory}/setup.php");
if (!$ok) {
if ($obj->mod_type != 'core') {
$AppUI->setMsg('Module setup file could not be found', UI_MSG_ERROR);
if ($cmd == 'remove') {
$sql = "DELETE FROM modules WHERE mod_id = {$mod_id}";
db_exec($sql);
echo db_error();
$AppUI->setMsg('Module has been removed from the modules list - please check your database for additional tables that may need to be removed', UI_MSG_ERROR);
}
$AppUI->redirect();
}
}
$setupclass = $config['mod_setup_class'];
if (!$setupclass) {
if ($obj->mod_type != 'core') {
示例2: CModule
CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version);
} else {
CAppUI::setMsg("Installation de '{$module->mod_name}' à la version {$module->mod_version} sur {$setup->mod_version}", UI_MSG_WARNING, true);
}
} else {
CAppUI::setMsg("Module '%s' non mis à jour", UI_MSG_WARNING, $module->mod_name);
}
}
// In case the setup has added some user prefs
CAppUI::buildPrefs();
error_reporting($old_er);
CAppUI::redirect();
}
$module = new CModule();
if ($mod_id) {
$module->load($mod_id);
$module->checkModuleFiles();
} else {
$module->mod_version = "all";
$module->mod_name = $mod_name;
}
if (!class_exists($setupclass = "CSetup{$module->mod_name}")) {
if ($module->mod_type != "core" && !$module->_files_missing) {
CAppUI::setMsg("CModule-msg-no-setup", UI_MSG_ERROR);
CAppUI::redirect();
}
}
if ($module->mod_type == "core" && in_array($cmd, array("remove", "install", "toggle"))) {
CAppUI::setMsg("Core modules can't be uninstalled or disactivated", UI_MSG_ERROR);
CAppUI::redirect();
}