Registers a plugin.

@param PluginBundle $plugin
@param array        $pluginConfiguration
347816
public function register(PluginBundle $plugin, array $pluginConfiguration)
    {
        $pluginFqcn = get_class($plugin);
        $this->dbWriter->insert($plugin, $pluginConfiguration);
    }
1125772
public function registerPlugins() {
		
		if($this->plugins) {
			foreach($this->plugins as $plugin) {
				$this->eventDispatcher->removeSubscriber($plugin);
			}
		}

		$this->plugins = array();
		
		// initialize plugins (if configured)
		
		if($this->config->plugins) {

			foreach(array_keys($this->config->plugins) as $pluginId) {
				$this->plugins[] = $this->initializePlugin($pluginId);
			}

		}

		return $this; 

	}
271156
public function registerPlugin($id, $dataProviders, $parents, $dataProviderName = null)
    {
        if (!isset($this->plugins[$id])) {
            $this->plugins[$id] = $this->pluginDescriptionFactory->create($id);
        }

        $this->plugins[$id]->setDataProviders($dataProviders);
        $this->plugins[$id]->setParents($parents);
        $this->plugins[$id]->setDataProviderName($dataProviderName);
    }
1123051
public function install(PluginBundleInterface $plugin)
    {
        $this->baseInstaller->install($plugin);

        $pluginEntity = $this->pluginManager->getPluginByShortName(
            $plugin->getName()
        );

        if (!$this->pluginManager->isReady($pluginEntity) || !$this->pluginManager->isActivatedByDefault($pluginEntity)) {
            $errors = $this->pluginManager->getMissingRequirements($pluginEntity);

            foreach ($errors['extensions'] as $extension) {
                $this->log(sprintf('<fg=red>Extension %s missing for %s !</fg=red>', $extension, $plugin->getName()));
            }

            foreach ($errors['plugins'] as $bundle) {
                $this->log(sprintf('<fg=red>The plugin %s is required for %s ! You must enable it first to use %s.</fg=red>', $bundle, $plugin->getName(), $plugin->getName()));
            }

            foreach ($errors['extras'] as $extra) {
                $this->log(sprintf('<fg=red>The plugin %s has extra requirements ! %s.</fg=red>', $plugin->getName(), $this->translator->trans($extra, [], 'error')));
            }

            $this->log(sprintf('<fg=red>Disabling %s...</fg=red>', $plugin->getName()));
            $this->pluginManager->disable($pluginEntity);
        }

        $this->versionManager->setLogger($this->logger);
        $version = $this->versionManager->register($plugin);
        $this->versionManager->execute($version);
    }
1015951
public function register(PluginBundleInterface $plugin)
    {
        $this->validate($plugin, false);

        return $this->dbWriter->insert($plugin, $this->validator->getPluginConfiguration());
    }
754836
public function registerParser($pluginName, $parser, $regexp = null, $limit = PHP_INT_MAX)
	{
		if (!is_callable($parser))
		{
			throw new InvalidArgumentException('Argument 1 passed to ' . __METHOD__ . ' must be a valid callback');
		}
		// Create an empty config for this plugin to ensure it is executed
		if (!isset($this->pluginsConfig[$pluginName]))
		{
			$this->pluginsConfig[$pluginName] = [];
		}
		if (isset($regexp))
		{
			$this->pluginsConfig[$pluginName]['regexp']      = $regexp;
			$this->pluginsConfig[$pluginName]['regexpLimit'] = $limit;
		}
		$this->pluginParsers[$pluginName] = $parser;
	}
786161
def register_plugin(name, &block)
      plugin = Plugin.new
      plugin.instance_eval(&block)
      @plugins[name] = plugin
    end
1300228
public function insert(PluginBundle $pluginBundle, array $pluginConfiguration)
    {
        $pluginEntity = new Plugin();
        $pluginEntity->setVendorName($pluginBundle->getVendorName());
        $pluginEntity->setBundleName($pluginBundle->getBundleName());
        $pluginEntity->setHasOptions($pluginConfiguration['has_options']);

        $this->em->persist($pluginEntity);
        $this->persistConfiguration($pluginConfiguration, $pluginEntity, $pluginBundle);
        $this->em->flush();
    }
499809
private function savePlugin(Plugin $plugin)
    {
        $this
            ->pluginObjectManager
            ->persist($plugin);

        $this
            ->pluginObjectManager
            ->flush($plugin);

        return $this;
    }
124113
public function add($plugin)
	{
		if (is_array($plugin))
		{
			$this->plugins = array_merge($this->plugins, $plugin);
		}
		else
		{
			$this->plugins[] = $plugin;
		}
		
		return $this;
	}
780711
def register_plugin(type, klass)
      type = type.to_s
      @plugins[type] ||= []
      @plugins[type].push(klass) unless @plugins[type].include?(klass)
    end
321459
protected function registerPackagesFromConfiguration($packageStatesConfiguration)
    {
        foreach ($packageStatesConfiguration['packages'] as $composerName => $packageStateConfiguration) {
            $this->registerPackageFromStateConfiguration($composerName, $packageStateConfiguration);
        }
    }
1171262
public function merge(PluginConfiguration $newPluginConfiguration)
    {
        $newPluginConfiguration = clone $newPluginConfiguration;
        $fields = $newPluginConfiguration->getFields();

        foreach ($fields as $fieldName => $field) {
            if ($this->hasField($fieldName)) {
                $newPluginConfiguration
                    ->setFieldValue(
                        $fieldName,
                        $this->getFieldValue($fieldName)
                    );
            }
        }

        $this->setConfiguration($newPluginConfiguration->getConfiguration());

        return $this;
    }
216689
public function uninstall(PluginBundleInterface $plugin)
    {
        $this->checkInstallationStatus($plugin, true);
        $this->log('Removing plugin configuration...');
        $this->recorder->unregister($plugin);
        $this->baseInstaller->uninstall($plugin);
    }
712650
function registerPlugin(name, obj) {
    if (name && name.length && obj) {
        plugins[name] = obj;
    }
}
446856
public function registerPlugin(Swift_Events_EventListener $plugin)
    {
        foreach ($this->transports as $transport) {
            $transport->registerPlugin($plugin);
        }
    }
597666
public function enablePlugin($pluginName)
	{
		if (isset($this->pluginsConfig[$pluginName]))
		{
			$this->pluginsConfig[$pluginName]['isDisabled'] = false;
		}
	}