Registers plugins to the given publisher.

@param MW_Observer_Publisher_Interface $publisher Publisher object
547300
public function register(MW_Observer_Publisher_Interface $publisher, $domain)
	{
		if( !empty( $this->_plugins ) )
		{
			foreach( $this->_plugins as $plugin ) {
				$plugin->register( $publisher );
			}

			return;
		}

		$search = $this->createSearch( true );

		$expr = array(
			$search->compare( '==', 'plugin.type.code', $domain ),
			$search->getConditions(),
		);

		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( array( $search->sort( '+', 'plugin.position' ) ) );

		$pluginItems = $this->searchItems( $search );

		$interface = 'MShop_Plugin_Provider_Interface';
		$context = $this->_getContext();

		foreach( $pluginItems as $pluginItem )
		{
			$domain = $pluginItem->getType();
			$providernames = explode( ',', $pluginItem->getProvider() );

			if( ( $providername = array_shift( $providernames ) ) === null )
			{
				$msg = sprintf( 'Provider in "%1$s" not available', $providernames );
				throw new MShop_Service_Exception( $msg );
			}

			if( ctype_alnum( $domain ) === false )
			{
				$msg = sprintf( 'Invalid characters in domain name "%1$s"', $domain );
				$context->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
				continue;
			}

			if( ctype_alnum( $providername ) === false )
			{
				$msg = sprintf( 'Invalid characters in provider name "%1$s"', $providername );
				$context->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
				continue;
			}


			$classname = 'MShop_Plugin_Provider_' . ucfirst( $domain ) . '_' . $providername;

			if( class_exists( $classname ) === false )
			{
				$msg = sprintf( 'Class "%1$s" not available', $classname );
				$context->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
				continue;
			}

			$provider = new $classname( $context, $pluginItem );

			if( ( $provider instanceof $interface ) === false )
			{
				$msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $interface );
				throw new MShop_Service_Exception( $msg );
			}


			$provider = $this->_addPluginDecorators( $pluginItem, $provider, $providernames );

			$config = $context->getConfig();
			$decorators = $config->get( 'mshop/plugin/provider/' . $pluginItem->getType() . '/decorators', array() );

			$provider = $this->_addPluginDecorators( $pluginItem, $provider, $decorators );


			$this->_plugins[$pluginItem->getId()] = $provider;
			$provider->register( $publisher );
		}
	}
564161
public function registerPlugin(Plugin $plugin)
    {
        try {
            $this->smarty->registerPlugin($plugin->getType(), $plugin->getName(), $plugin->getCallbackFunction(),
                $plugin->getAttribute('Cachable', true), $plugin->getAttribute('CacheAttr', null));
        } catch (\SmartyException $e) {
            throw new SmartyException($e);
        }
    }
649388
public function register(WsdlManager $wsdlManager)
	{
		$wsdlManager->addWebServiceListener(WebService::EVENT_SUCCESS, [$this, 'logEvent']);
		$wsdlManager->addWebServiceListener(WebService::EVENT_FAILURE, [$this, 'logEvent']);
		Tracy\Debugger::getBar()->addPanel($this);
	}
1188318
public function addPlugin(ServerPlugin $plugin)
    {
        $this->plugins[$plugin->getPluginName()] = $plugin;
        $plugin->initialize($this);
    }
1261552
def add_publisher(publisher)
      @master.register_publisher(publisher.topic_name,
                                 publisher.topic_type.type)
      publisher.set_manager(self)
      @publishers.push(publisher)
      publisher
    end
780711
def register_plugin(type, klass)
      type = type.to_s
      @plugins[type] ||= []
      @plugins[type].push(klass) unless @plugins[type].include?(klass)
    end
672825
public function setPublisher($publisher)
    {
        ObjectHelper::isInstanceOf($publisher, [Organization::class, Person::class]);
        
        $this->_publisher = $publisher;
        return $this;
    }
166035
public static function addBroadcaster(BroadcasterInterface $broadcaster)
    {
        self::instantiateDefaultBroadcasters();
        self::$broadcasters[$broadcaster->getName()] = $broadcaster;
    }
420135
protected function registerViewPublishCommand(): void
    {
        $this->app->singleton('command.view.publish', function (Application $app) {
            return new ViewPublishCommand($app->make('view.publisher'));
        });
    }
195593
def register(self, plugin):
        
        if plugin.name not in self._registered:
            logger.info('Registering plugin %s' % plugin.name)
            self._registered[plugin.name] = plugin
        else:
            logger.warn('Plugin %s already registered' % plugin.name)
1064924
private function registerPlugin(Plugin $plugin): void
    {
        if ($this->hasPlugin($plugin->getName())) {
            return;
        }

        $this->plugins[$plugin->getName()] = $plugin;
    }
75135
protected function registerPublishes(): void
    {
        $this->publishes([
            $this->packagePath('config') => config_path('/'),
        ], 'config');

        $this->publishes([
            $this->homeDirectory . '/../resources/lang' => base_path('resources/lang/vendor/' . $this->packageName),
        ], 'language');
    }
460058
protected function registerPluginSubscribers(array $plugins)
    {
        $client = $this->getClient();
        foreach ($plugins as $plugin) {
            $this->validatePluginEvents($plugin);
            $callbacks = $plugin->getSubscribedEvents();
            foreach ($callbacks as $event => $callback) {
                $pluginCallback = [ $plugin, $callback ];
                if (is_callable($pluginCallback)) {
                    $callback = $pluginCallback;
                }
                $client->on($event, $callback);
            }
        }
    }
1223911
protected function registerPublishes()
    {
        // Config
        $this->publishes(
            [
                __DIR__ . '/../../../config/config.php' => config_path('gzero.php'),
            ],
            'gzero-core config'
        );

        // Factories
        $this->publishes(
            [
                __DIR__ . '/../../../database/factories/UserFactory.php' => database_path('factories/gzero.php'),
            ],
            'gzero-core factories'
        );

        // Views
        $this->publishes(
            [
                __DIR__ . '/../../../resources/views' => resource_path('views/vendor/gzero-core'),
            ],
            'gzero-core views'
        );
    }
1271363
public function execute(Observer $observer)
    {
        /** @var Subscriber $subscriber */
        $subscriber = $observer->getSubscriber();

        try {
            $store = $this->storeManager->getStore($subscriber->getStoreId());

            if ($subscriber->getCustomerId()) {
                $this->customerEventHandler->store(
                    $subscriber->getCustomerId(),
                    $store->getWebsiteId(),
                    $store->getId()
                );
            } else {
                $this->subscriptionEventHandler->store(
                    $subscriber,
                    $store->getWebsiteId(),
                    $store->getId(),
                    $this->subscriptionEventHandler->getEventType($observer->getEvent()->getName())
                );
            }
        } catch (\Exception $e) {
            $this->logger->warning('Emartech\\Emarsys\\Observers\\SubscriptionObserver: ' . $e->getMessage());
        }
    }
845674
public function registerPlugins()
    {
        foreach($this->activePlugins() as $plugin){
            $className = $plugin->parseNamespace()."\\Plugin";
            if(class_exists($className)) {
                $pluginInstance = new $className();
                if ($plugin->isActive() && method_exists($pluginInstance, 'register')) {
                    $pluginInstance->register();
                    $this->registeredPlugins[] = $plugin;
                }
            }
        }
        return;
    }
1370149
public function registerEventListeners(DispatcherContract $dispatcher): void
    {
        $events = \array_merge_recursive(
            (\method_exists($this, 'discoveredEvents') ? $this->discoveredEvents() : []),
            $this->listens()
        );

        foreach ($events as $event => $listeners) {
            foreach (\array_unique($listeners) as $listener) {
                $dispatcher->listen($event, $listener);
            }
        }

        foreach ($this->subscribe as $subscriber) {
            $dispatcher->subscribe($subscriber);
        }
    }