本文整理汇总了PHP中Plugins::deactivate_plugin方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugins::deactivate_plugin方法的具体用法?PHP Plugins::deactivate_plugin怎么用?PHP Plugins::deactivate_plugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins::deactivate_plugin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_plugin_activation
/**
* Don't bother loading if the gd library isn't active
*/
public function action_plugin_activation($file)
{
if (!function_exists('imagecreatefromjpeg')) {
Session::error(_t("Habari Silo activation failed. PHP has not loaded the gd imaging library."));
Plugins::deactivate_plugin(__FILE__);
}
}
示例2: action_init
/**
* function action_init
* A function which makes sure we are good to go for plugin activation.
*/
public function action_init()
{
if (!class_exists('RenderCache')) {
Session::error(_t("LaTeX activation failed. This plugin requires the RenderCache class which was not found."));
Plugins::deactivate_plugin(__FILE__);
//Deactivate plugin
Utils::redirect();
//Refresh page. Unfortunately, if not done so then results don't appear
}
}
示例3: action_plugin_activation
/**
* Don't bother loading if the gd library isn't active
*/
public function action_plugin_activation($file)
{
if (!function_exists('imagecreatefromjpeg')) {
Session::error(_t("Habari Silo activation failed. PHP has not loaded the gd imaging library."));
Plugins::deactivate_plugin(__FILE__);
}
// Create required tokens
ACL::create_token('create_directories', _t('Create media silo directories'), 'Administration');
ACL::create_token('delete_directories', _t('Delete media silo directories'), 'Administration');
ACL::create_token('upload_media', _t('Upload files to media silos'), 'Administration');
ACL::create_token('delete_media', _t('Delete files from media silos'), 'Administration');
}
示例4: action_init
/**
* Initialize by added directory variables
*/
public function action_init()
{
$this->logs = dirname(__FILE__) . '/logs';
$this->cache = dirname(__FILE__) . '/cache';
if (!$this->confirm_dirs($error)) {
Session::error("Clickheat error: {$error}");
Plugins::deactivate_plugin(__FILE__);
// Deactivate plugin
Utils::redirect();
//Refresh page
exit;
}
}
示例5: action_plugin_activation
/**
* Do some checking and setting up.
*/
public function action_plugin_activation($file)
{
// Don't bother loading if the gd library isn't active
if (!function_exists('imagecreatefromjpeg')) {
Session::error(_t("Simple Gallery activation failed. PHP has not loaded the gd imaging library."));
Plugins::deactivate_plugin(__FILE__);
} else {
/*
$this->silo = new HabariSilo();
$this->silo->action_init();
$this->silo->mkdir('simplegallery');
*/
}
}
示例6: get_plugin_toggle
/**
* Handles plugin activation or deactivation.
*/
public function get_plugin_toggle()
{
$extract = $this->handler_vars->filter_keys('plugin_id', 'action');
foreach ($extract as $key => $value) {
${$key} = $value;
}
$plugins = Plugins::list_all();
foreach ($plugins as $file) {
if (Plugins::id_from_file($file) == $plugin_id) {
switch (strtolower($action)) {
case 'activate':
if (Plugins::activate_plugin($file)) {
$plugins = Plugins::get_active();
Session::notice(_t("Activated plugin '%s'", array($plugins[Plugins::id_from_file($file)]->info->name)), $plugins[Plugins::id_from_file($file)]->plugin_id);
}
break;
case 'deactivate':
if (Plugins::deactivate_plugin($file)) {
$plugins = Plugins::get_active();
Session::notice(_t("Deactivated plugin '%s'", array($plugins[Plugins::id_from_file($file)]->info->name)), $plugins[Plugins::id_from_file($file)]->plugin_id);
}
break;
default:
Plugins::act('adminhandler_get_plugin_toggle_action', $action, $file, $plugin_id, $plugins);
break;
}
}
}
Utils::redirect(URL::get('admin', 'page=plugins'));
}
示例7: action_plugin_ui_uninstall
/**
* Respond to uninstalling this plugin in the plugin UI
*/
public function action_plugin_ui_uninstall()
{
// get all the posts of the types we're deleting
$addons = Posts::get(array('content_type' => array('addon'), 'nolimit' => true));
foreach ($addons as $addon) {
$addon->delete();
}
// now that the posts are gone, delete the type - this would fail if we hadn't deleted the content first
Post::delete_post_type('addon');
// remove vocabulary and terms
$vocabulary = $this->vocabulary;
if ($vocabulary) {
$vocabulary->delete();
}
// now deactivate the plugin
Plugins::deactivate_plugin(__FILE__);
Session::notice(_t("Uninstalled plugin '%s'", array($this->info->name), 'addon_catalog'));
// redirect to the plugins page again so the page updates properly - this is what AdminHandler does after plugin deactivation
Utils::redirect(URL::get('admin', 'page=plugins'));
}