Deactivate plugin

@param string $pluginName Name of plugin
339183
public function deactivatePlugin($pluginName)
    {
        $this->clearCache($pluginName);

        // execute deactivate() to let the plugin do cleanups
        $this->executePluginDeactivate($pluginName);

        $this->unloadPluginFromMemory($pluginName);

        $this->removePluginFromConfig($pluginName);

        /**
         * Event triggered after a plugin has been deactivated.
         *
         * @param string $pluginName The plugin that has been deactivated.
         */
        Piwik::postEvent('PluginManager.pluginDeactivated', array($pluginName));
    }
965340
public function deletePlugin($provider, $pluginId)
    {
        foreach ($this->providersByCompatibility[$provider] as $titleProviders) {
            foreach ($titleProviders as $modeProviders) {
                foreach ($modeProviders as $providerId) {
                    $providerService = $this->container->get($providerId);
                    $providerService->deletePlugin($pluginId);
                }
            }
        }
    }
509152
public static function uninstall($pluginname) {
        global $DB;

        list($a, $b) = core_component::normalize_component($pluginname);
        if (empty($b) || $a === 'core') {
            throw new coding_exception('Core component can not be uninstalled');
        }
        $component = $a . '_' . $b;

        core_tag_tag::delete_instances($component);

        $DB->delete_records('tag_area', array('component' => $component));
        $DB->delete_records('tag_coll', array('component' => $component));
        cache::make('core', 'tags')->delete_many(array('tag_area', 'tag_coll'));
    }
1305292
public function uninstall(Composer $composer, IOInterface $io, $pluginName)
    {
        $plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
        
        if ($plugin) {
            $result = $this->wp(function () use ($plugin) {
                return uninstall_plugin($plugin);
            });
            
            $this->succeeded(__FUNCTION__, $pluginName, $result === true || $result === null);
        }
    }
294122
function Plugin(session, name, id) {
  Plugin.super_.call(this);
  this._session = session;
  this._name = name;
  this._id = id;

  var plugin = this;
  session.on('destroy', function() {
    plugin._detach();
  });
}
268670
public static function unload($plugin = null)
    {
        if (self::loaded($plugin)) {
            $locales = Configure::read('App.paths.locales');
            foreach ($locales as $key => $path) {
                if ($path == self::getLocalePath($plugin)) {
                    unset($locales[$key]);
                }
            }

            Configure::write('App.paths.locales', $locales);
        }

        parent::unload($plugin);
    }
1039796
def unload_plug_in(self, name):
        
        if not isinstance(name, basestring):
            raise TypeError("name can only be an instance of type basestring")
        self._call("unloadPlugIn",
                     in_p=[name])
1063084
public function unloadPlugin($plugin)
    {
        $this->resetTransientCache();

        if (!($plugin instanceof Plugin)) {
            $oPlugin = $this->loadPlugin($plugin);
            if ($oPlugin === null) {
                unset($this->loadedPlugins[$plugin]);
                return;
            }

            $plugin = $oPlugin;
        }

        unset($this->loadedPlugins[$plugin->getPluginName()]);
    }
386756
public function uninstall($themeName)
    {
        $theme = plugin($themeName); // throws
        if (!in_array($themeName, [option('front_theme'), option('back_theme')])) {
            if (!$theme->requiredBy()->isEmpty()) {
                $this->Flash->danger(__d('system', 'You cannot remove this theme!'));
            } else {
                $task = (bool)WebShellDispatcher::run("Installer.plugins uninstall -p {$theme->name}");
                if ($task) {
                    $this->Flash->success(__d('system', 'Theme successfully removed!'));
                } else {
                    $this->Flash->set(__d('system', 'Theme could not be removed'), [
                        'element' => 'System.installer_errors',
                        'params' => ['errors' => WebShellDispatcher::output()],
                    ]);
                }
            }
        } else {
            $this->Flash->danger(__d('system', 'This theme cannot be removed as it is currently being used.'));
        }

        $this->title(__d('system', 'Uninstall Theme'));
        $this->redirect($this->referer());
    }
408575
public static function get_plugin_directory($plugintype, $pluginname) {
        if (empty($pluginname)) {
            // Invalid plugin name, sorry.
            return null;
        }

        self::init();

        if (!isset(self::$plugins[$plugintype][$pluginname])) {
            return null;
        }
        return self::$plugins[$plugintype][$pluginname];
    }
901593
public function migrate($pluginName = null)
    {
        $slug = Inflector::underscore($pluginName);
        /** @var Extension $plugin */
        $plugin = $this->Extensions->findBySlug($slug)->first();

        $redirectAction = ['action' => 'index'];
        if ($plugin !== null && Plugin::loaded($plugin->name)) {
            $migration  = new Migration($plugin->name);
            $migrations = $migration->getData();
            $pluginDomainName = sprintf('<strong>%s</strong>', __d($plugin->slug, $plugin->name));

            if (count($migrations) <= 0) {
                $this->Flash->error(__d('extensions', 'Not found migration for «{0}»', $pluginDomainName));
                return $this->redirect($redirectAction);
            }

            try {
                $manager = $migration->getManager();
                $result  = $manager->migrateUp();

                if (count($result)) {
                    $this->Flash->success(__(implode('<br />', $result)));
                    return $this->redirect($redirectAction);
                }

                $this->Flash->success(__d('extensions', 'Something went wrong. try later'));
                return $this->redirect($redirectAction);
            } catch (\PDOException $e) {
                $this->Flash->error(__d('extensions', $e->getMessage()));
                return $this->redirect($redirectAction);
            }
        }

        $this->Flash->error(__d('extensions', 'Not found «{0}» plugin', $pluginName));
        return $this->redirect($redirectAction);
    }
129165
public function remove($name)
    {
        unset($this->plugins[$name]);
        $this->names = array_keys($this->plugins);

        return $this;
    }
132218
protected function _pluginPath($pluginName)
    {
        if (Plugin::isLoaded($pluginName)) {
            return Plugin::path($pluginName);
        }

        return current(App::path('Plugin')) . $pluginName . DIRECTORY_SEPARATOR;
    }
1133030
public function deactivateGroup($featureName, $groupName)
    {
        $feature = $this->getFeature($featureName);
        $feature->removeGroup($groupName);
        $this->saveFeature($feature);
    }
809079
public function activatePlugin($pluginName)
    {
        $plugins = $this->pluginList->getActivatedPlugins();
        if (in_array($pluginName, $plugins)) {
            // plugin is already activated
            return;
        }

        if (!$this->isPluginInFilesystem($pluginName)) {
            throw new \Exception("Plugin '$pluginName' cannot be found in the filesystem in plugins/ directory.");
        }
        $this->deactivateThemeIfTheme($pluginName);

        // Load plugin
        $plugin = $this->loadPlugin($pluginName);
        if ($plugin === null) {
            throw new \Exception("The plugin '$pluginName' was found in the filesystem, but could not be loaded.'");
        }
        $this->installPluginIfNecessary($plugin);
        $plugin->activate();

        EventDispatcher::getInstance()->postPendingEventsTo($plugin);

        $this->pluginsToLoad[] = $pluginName;

        $this->updatePluginsConfig($this->pluginsToLoad);
        PiwikConfig::getInstance()->forceSave();

        $this->clearCache($pluginName);

        /**
         * Event triggered after a plugin has been activated.
         *
         * @param string $pluginName The plugin that has been activated.
         */
        Piwik::postEvent('PluginManager.pluginActivated', array($pluginName));
    }
676592
public function delete($name)
	{
		$templates = $this->getTemplates();
		$templates->delete($name, $this->plugin->name);
	}
711324
def disable_plugin(plugin_name):
    '''
    
    '''
    if isinstance(plugin_name, types.StringTypes):
        plugin_name = [plugin_name]

    # Verify all specified plugins are currently enabled.
    enabled_path = MICRODROP_CONDA_PLUGINS.joinpath('enabled')
    for name_i in plugin_name:
        plugin_path_i = enabled_path.joinpath(name_i)
        if not _islinklike(plugin_path_i) and not plugin_path_i.isdir():
            raise IOError('Plugin `{}` not found in `{}`'
                          .format(name_i, enabled_path))

    # All specified plugins are enabled.

    # Remove all specified plugins from
    # `<conda prefix>/etc/microdrop/plugins/enabled/`.
    for name_i in plugin_name:
        plugin_link_path_i = enabled_path.joinpath(name_i)
        plugin_link_path_i.unlink()
        logger.debug('Disabled plugin `%s` (i.e., removed `%s`)',
                     plugin_path_i, plugin_link_path_i)