本文整理汇总了PHP中Widgets::uninstall方法的典型用法代码示例。如果您正苦于以下问题:PHP Widgets::uninstall方法的具体用法?PHP Widgets::uninstall怎么用?PHP Widgets::uninstall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widgets
的用法示例。
在下文中一共展示了Widgets::uninstall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
/**
* Uninstall a deactivated module. This will call <module>_installer::uninstall() which should
* take whatever steps necessary to make sure that all traces of a module are gone.
* @param string $module_name
*/
public static function uninstall($module_name)
{
//Call DB migrations for this module
self::migrate($module_name, 'down');
$installer_class = ucfirst($module_name) . '_Installer';
if (is_callable(array($installer_class, "uninstall"))) {
call_user_func(array($installer_class, "uninstall"));
}
$module = self::get($module_name);
if ($module->loaded()) {
$module->delete();
}
self::load_modules(TRUE);
// remove widgets when the module is uninstalled
Widgets::uninstall($module_name);
Log::info('Uninstalled module :module_name', array(':module_name' => $module_name));
}
示例2: delete
/**
* The Delete action of the Admin module should be triggered through an HTTP POST request in order to
* uninstall a widget that was installed in the widget repository.
*
* @param string $widget The identifier of the widget that must uninstalled from the widget repository.
*/
public function delete($widget)
{
// Security check.
if (!Auth::isAuth() && (Auth::isAdmin() || Auth::isGod())) {
DefaultFC::redirection('users/index?ref=admin');
}
// Action
Widgets::uninstall($widget);
$_SESSION['isError'] = false;
$_SESSION['message'] = __("The widget has been deleted successfully.");
DefaultFC::redirection('admin/index');
}