Enable one or several plugins. Will properly handle being passed a plugin that is already disabled
@param string|array $plugin,... a string, or several strings, or a single array of strings - The plugins to enable
@return $this
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;
    }
903195
public function appendPlugin(Plugin ...$plugins)
    {
        foreach ($plugins as $plugin) {
            $this->appendPlugins[] = $plugin;
        }

        return $this;
    }
23751
def add_plugin(self, plugin):
        
        self.plugin_by_name[plugin.get_plugin_name()] = plugin
        self.plugins.append(plugin)
620312
public function setPlugin(\BlackForest\PiwikBundle\Entity\PiwikVisitPlugin $plugin = null)
    {
        $this->plugin = $plugin;

        return $this;
    }
129165
public function remove($name)
    {
        unset($this->plugins[$name]);
        $this->names = array_keys($this->plugins);

        return $this;
    }
817659
public function disablePlugin($pluginName)
	{
		if (isset($this->pluginsConfig[$pluginName]))
		{
			// Copy the plugin's config to remove the reference
			$pluginConfig = $this->pluginsConfig[$pluginName];
			unset($this->pluginsConfig[$pluginName]);

			// Update the value and replace the plugin's config
			$pluginConfig['isDisabled'] = true;
			$this->pluginsConfig[$pluginName] = $pluginConfig;
		}
	}
1188318
public function addPlugin(ServerPlugin $plugin)
    {
        $this->plugins[$plugin->getPluginName()] = $plugin;
        $plugin->initialize($this);
    }
852704
public function validatePlugin($plugin)
    {
        if ($plugin instanceof MapperInterface) {
            return; // we're okay
        }

        throw new \InvalidArgumentException(sprintf(
            'Can\'t create mapper for %s; Mapper must implement %s',
            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
            MapperInterface::class
        ));
    }
699393
public void enable() throws IOException {
        if (!disableFile.exists()) {
            LOGGER.log(Level.FINEST, "Plugin {0} has been already enabled. Skipping the enable() operation", getShortName());
            return;
        }
        if(!disableFile.delete())
            throw new IOException("Failed to delete "+disableFile);
    }
1221825
public static function unload($plugin = null)
    {
        deprecationWarning('Plugin::unload() will be removed in 4.0. Use PluginCollection::remove() or clear()');
        if ($plugin === null) {
            static::getCollection()->clear();
        } else {
            static::getCollection()->remove($plugin);
        }
    }
1102010
public function getPluginOption($plugin, $option = null)
    {
        $option = $option ? '.'.$option : '';

        return $this->config->get('plugins.config.'.$plugin.$option);
    }
881198
function setPlugin (plugin) {
          if (plugin) {
            api._ = plugin;
            api.parentElement = plugin.parentElement;
            api.$ = $(plugin);
          }
          else {
            api._ = null;
            api.parentElement = null;
            api.$ = $();
          }
        }
1220646
public function removePlugin($key) {
        if (!isset($this->plugins[$key])) {
            return $this;
        }
        if (method_exists($this->plugins[$key], 'unconfigure')) {
            $this->plugins[$key]->unconfigure($this);
        }
        unset($this->plugins[$key]);
        return $this;
    }
109345
public function loadPlugin(AbstractPlugin $plugin)
    {
        $name = $plugin->getName();
        $this->log->addDebug('--- Loading plugin ' . $name . PHP_EOL);

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

        return $this;
    }
23765
public static function plugin($plugin)
    {
        $templates = [];

        foreach (App::path('Template', $plugin) as $path) {
            $templates = array_merge($templates, static::iteratePath($path));
        }

        return $templates;
    }
1354986
public function registerPlugin(array $plugin)
    {
        /* Dont't process nameless plugins */
        if(! isset($plugin['name'])) return;

        /* Create a container for the plugin */
        $this->getContainer()->addPlugin($plugin['name']);

        /* Commands are registered first so they can be found be porcedures */
        if(isset($plugin['commands'])) {
            $this->registerCommands($plugin['name'], $plugin['commands']);
        }

        if(isset($plugin['procedures'])) {
            /* The path info is appended by ComposerScripts */
            $this->registerProcedures($plugin['name'], $plugin['procedures'], $plugin['path']);
        }

        if(isset($plugin['settings'])) {
            $this->registerSettings($plugin['name'], $plugin[ 'settings' ]);
        }
    }
617788
function Plugin() {
    this.each(function () {
      var $this = $(this);
      var data = $this.data('bui.disable');

      if (!data) {
        data = new Disable($this);
        $this.data('bui.disable', data);
      }

      data.toggle();
    });

    return this;
  }