本文整理匯總了PHP中CModule::loadMatchingList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CModule::loadMatchingList方法的具體用法?PHP CModule::loadMatchingList怎麽用?PHP CModule::loadMatchingList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CModule
的用法示例。
在下文中一共展示了CModule::loadMatchingList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CModule
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkAdmin();
$cmd = CValue::post("cmd");
$mod_id = CValue::post("mod_id");
$mod_name = CValue::post("mod_name");
$mobile = CValue::post("mobile", 0);
// If it we come from the installer script
if ($cmd == "upgrade-core") {
// we deactivate errors under error
$old_er = error_reporting(E_ERROR);
$module = new CModule();
$module->mod_type = "core";
/** @var CModule[] $list_modules */
$list_modules = $module->loadMatchingList();
foreach ($list_modules as $module) {
$setupClass = "CSetup{$module->mod_name}";
/** @var CSetup $setup */
$setup = new $setupClass();
if ($module->mod_version = $setup->upgrade($module->mod_version)) {
$module->mod_type = $setup->mod_type;
$module->store();
if ($setup->mod_version == $module->mod_version) {
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);
}
示例2: CModule
* @subpackage System
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 19290 $
*/
CCanDo::checkAdmin();
$cmd = CValue::get("cmd");
$mod_id = CValue::get("mod_id");
$mod_name = CValue::get("mod_name");
// If it we come from the installer script
if ($cmd == "upgrade-core") {
// we deactivate errors under error
$old_er = error_reporting(E_ERROR);
$module = new CModule();
$module->mod_type = "core";
$list_modules = $module->loadMatchingList($module->_spec->key);
foreach ($list_modules as $module) {
$setupClass = "CSetup{$module->mod_name}";
/** @var CSetup $setup */
$setup = new $setupClass();
if ($module->mod_version = $setup->upgrade($module->mod_version, true)) {
$module->mod_type = $setup->mod_type;
$module->store();
if ($setup->mod_version == $module->mod_version) {
CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version);
} else {
CAppUI::setMsg("Installation de '%s' à la version %s sur %s", UI_MSG_WARNING, $module->mod_name, $module->mod_version, $setup->mod_version);
}
} else {
CAppUI::setMsg("Module '%s' non mis à jour", UI_MSG_WARNING, $module->mod_name);
}