Activate plugin by their name.

@param string $plugin

@return void
484900
protected function activatePlugin(string $plugin): void
    {
        require_once WPMU_PLUGIN_DIR.'/'.$plugin;

        do_action('activate_'.$plugin);

        $plugins = $this->getActivePlugins();
        $plugins[] = $plugin;

        $this->setActivePlugins($plugins);
    }
1051879
protected function _triggerAfterEvents(PluginPackage $plugin)
    {
        $affix = ucwords($this->params['status']);
        try {
            $this->trigger("Plugin.{$plugin->name}.after{$affix}");
        } catch (\Exception $e) {
            $this->err(__d('installer', 'Plugin did not respond to "after{0}" callback properly.', $affix));
        }
    }
153777
public static function activatePlugin($configClass)
    {
        if (isset(static::$plugins[$configClass])) {
            static::$plugins[$configClass][static::IS_ACTIVE] = true;
            /** @var \Brainworxx\Krexx\Service\Plugin\PluginConfigInterface $staticPlugin */
            $staticPlugin = static::$plugins[$configClass][static::CONFIG_CLASS];
            $staticPlugin::exec();

            if (isset(Krexx::$pool)) {
                // Update stuff in the pool.
                Krexx::$pool->rewrite = static::$rewriteList;
                Krexx::$pool->eventService->register = static::$eventList;
                Krexx::$pool->messages->readHelpTexts();
            }
        }
        // No registration, no config, no plugin.
        // Do nothing.
    }
698810
function applyPlugin(plugin, next) {
    self.pack.register(plugin.plugin, plugin.options || {}, function(err) {
      if(err) return next(err);
      else    return next();
    });
  }
236379
public static function add($hook, $plugin)
    {
        // Make sure the hook index exists
        if (!isset(static::$plugins[$hook])) {
            static::$plugins[$hook] = array();
        }

        // Add the plugin
        static::$plugins[$hook][] = $plugin;
    }
731319
protected function registerPlugin($pluginName = null) {
		$view = $this->view;

		$className      = static::className();
		$assetClassName = $className."Asset";
		if (empty($pluginName)) {
			$pluginName = strtolower(StringHelper::basename($className));
		}
		if (class_exists($assetClassName)) {
			/**
			 * @var \simialbi\yii2\web\AssetBundle $assetClassName
			 */
			$assetClassName::register($view);
		}

		$id = $this->options['id'];

		if ($this->clientOptions !== false) {
			$options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);
			$js      = "jQuery('#$id').$pluginName($options);";
			$view->registerJs($js);
		}

		$this->registerClientEvents();
	}
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);
    }
1079603
public function activate(Composer $composer, IOInterface $io, $pluginName)
    {
        $plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
        
        if ($plugin) {
            $result = $this->wp(function () use ($plugin) {
                wp_cache_set('plugins', [], 'plugins');
                
                return activate_plugin($plugin);
            });
            
            $this->succeeded(__FUNCTION__, $pluginName, $result === null);
        }
    }
696538
public function validatePlugin($plugin)
    {
        try {
            $this->validate($plugin);
        } catch (InvalidServiceException $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }
    }
384882
def deactivate(name):
    
    if name in plugins:
        plugins[name].deactivate()
    else:
        raise Exception("plugin {} not found".format(name))
1294660
public function registerPlugin(string $plugin)
    {
        if (!in_array($plugin, $this->plugins)) {
            $this->plugins[] = $plugin;
        }

        return true;
    }
7652
public function disablePlugins($plugin)
    {
        $plugins = func_get_args();
        if (is_array(current($plugins))) {
            $plugins = current($plugins);
        }
        foreach ($plugins as $name) {
            unset($this->plugins[$name]);
        }
        return $this;
    }
130525
def activate(name):
    
    if name in plugins:
        plugins[name].activate()
    else:
        raise Exception("plugin {} not found".format(name))
1119576
public function enableAction(Plugin $plugin)
    {
        $this->pluginManager->enable($plugin);

        return new JsonResponse(
            $this->pluginManager->getPluginsData()
        );
    }
124113
public function add($plugin)
	{
		if (is_array($plugin))
		{
			$this->plugins = array_merge($this->plugins, $plugin);
		}
		else
		{
			$this->plugins[] = $plugin;
		}
		
		return $this;
	}
877803
function init() {
        $this->blockname = get_class($this);
        $this->title = get_string('pluginname', $this->blockname);
    }
676592
public function delete($name)
	{
		$templates = $this->getTemplates();
		$templates->delete($name, $this->plugin->name);
	}