当前位置: 首页>>代码示例>>PHP>>正文


PHP Plugins::deactivate_plugin方法代码示例

本文整理汇总了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__);
     }
 }
开发者ID:anupom,项目名称:my-blog,代码行数:10,代码来源:habarisilo.plugin.php

示例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
     }
 }
开发者ID:justinjstark,项目名称:jLaTeX,代码行数:14,代码来源:jLaTeX.plugin.php

示例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');
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:15,代码来源:habarisilo.plugin.php

示例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;
     }
 }
开发者ID:habari-extras,项目名称:clickheat,代码行数:16,代码来源:clickheat.plugin.php

示例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');
         */
     }
 }
开发者ID:habari-extras,项目名称:simplegallery,代码行数:17,代码来源:simplegallery.plugin.php

示例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'));
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:33,代码来源:adminhandler.php

示例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'));
 }
开发者ID:habari-extras,项目名称:addon_catalog,代码行数:23,代码来源:addon_catalog.plugin.php


注:本文中的Plugins::deactivate_plugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。