本文整理匯總了PHP中graphics::activate_rules方法的典型用法代碼示例。如果您正苦於以下問題:PHP graphics::activate_rules方法的具體用法?PHP graphics::activate_rules怎麽用?PHP graphics::activate_rules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類graphics
的用法示例。
在下文中一共展示了graphics::activate_rules方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: activate
/**
* Activate an installed module. This will call <module>_installer::activate() which should take
* any steps to make sure that the module is ready for use. This will also activate any
* existing graphics rules for this module.
* @param string $module_name
*/
static function activate($module_name)
{
module::_add_to_path($module_name);
$installer_class = "{$module_name}_installer";
if (class_exists($installer_class) && method_exists($installer_class, "activate")) {
call_user_func_array(array($installer_class, "activate"), array());
}
$module = module::get($module_name);
if ($module->loaded()) {
$module->active = true;
$module->save();
}
module::load_modules();
graphics::activate_rules($module_name);
block_manager::activate_blocks($module_name);
log::success("module", t("Activated module %module_name", array("module_name" => $module_name)));
}
示例2: activate
/**
* Activate an installed module. This will call <module>_installer::activate() which should take
* any steps to make sure that the module is ready for use. This will also activate any
* existing graphics rules for this module.
* @param string $module_name
*/
static function activate($module_name)
{
$kohana_modules = Kohana::config("core.modules");
array_unshift($kohana_modules, MODPATH . $module_name);
Kohana::config_set("core.modules", $kohana_modules);
$installer_class = "{$module_name}_installer";
if (method_exists($installer_class, "activate")) {
call_user_func_array(array($installer_class, "activate"), array());
}
$module = self::get($module_name);
if ($module->loaded) {
$module->active = true;
$module->save();
}
module::load_modules();
graphics::activate_rules($module_name);
log::success("module", t("Activated module %module_name", array("module_name" => $module_name)));
}