registerListeners

@return  void
182297
protected function registerListeners()
    {
        $listeners  = (array) $this->get('listeners');
        $dispatcher = $this->getDispatcher();

        $defaultOptions = [
            'class' => '',
            'priority' => ListenerPriority::NORMAL,
            'enabled' => true,
        ];

        foreach ($listeners as $name => $listener) {
            if ($listener instanceof ClassMeta || is_string($listener) || is_callable($listener)) {
                $listener = ['class' => $listener];
            }

            $listener = array_merge($defaultOptions, (array) $listener);

            if (!$listener['enabled']) {
                continue;
            }

            if (!is_numeric($name) && is_callable($listener['class'])) {
                $dispatcher->listen($name, $listener['class']);
            } else {
                $dispatcher->addListener($this->container->newInstance($listener['class']), $listener['priority']);
            }
        }
    }
759790
public static function loadListeners()
    {
        $manager = self::instance();
        $plugins = Plugin::loaded();

        foreach ($plugins as $plugin) {
            $events = Plugin::getData($plugin, 'events')->getArrayCopy();
            foreach ($events as $name => $config) {
                if (is_numeric($name)) {
                    $name   = $config;
                    $config = [];
                }

                $class  = App::className($name, 'Event');
                $config = (array) $config;

                if ($class !== false) {
                    $listener = new $class($config);
                    $manager->on($listener, $config);
                }
            }
        }
    }
1158917
public function register()
  {
    $events = $this->register;

    foreach($events as $name => $event) {
      Events::listen($name, $event);
    }
  }
1322172
public function registerEvents()
    {
        if (!empty($this->clientEvents)) {
            $js = [];
            foreach ($this->clientEvents as $event => $handle) {
                $js[] = "jQuery('#{$this->options['id']}').on('{$event}',{$handle});";
            }
            $this->getView()->registerJs(implode(PHP_EOL, $js));
        }
    }
996612
protected void registerListenerAttributes() {
        addAttributeProcessor(new ConditionLmlAttribute(), "if");
        addAttributeProcessor(new KeepListenerLmlAttribute(), "keep");
        addAttributeProcessor(new ListenerIdsLmlAttribute(), "ids");
        // InputListener:
        addAttributeProcessor(new CombinedKeysLmlAttribute(), "combined");
        addAttributeProcessor(new ListenerKeysLmlAttribute(), "keys");
    }
1338969
public function registerListeners(array $listeners)
    {
        foreach ($listeners as $event => $listener) {
            $this->events[$event][] = $listener;
        }
    }
1222377
public void addListeners()
    {
        super.addListeners();
        this.addMainKeyBehavior();
        if (!this.getHeaderRecord().getField(ClassInfo.CLASS_NAME).isNull())
        {
            if (this.getMainRecord().getEditMode() != DBConstants.EDIT_CURRENT)
                if (this.getMainRecord().getEditMode() != DBConstants.EDIT_IN_PROGRESS)
                    this.getMainRecord().getField(FileHdr.FILE_NAME).moveFieldToThis(this.getHeaderRecord().getField(ClassInfo.CLASS_NAME));    // Current filename
        }
    }
239752
private function registerListenerMakeCommand()
    {
        $this->app->bindShared('command.make.package.listener', function ($app)
        {
            return new ListenerMakeCommand($app['files'], $app['packages']);
        });

        $this->commands('command.make.package.listener');
    }
573530
protected function loadEventListeners()
    {
        $coreListeners = [
            \Raideer\Tweech\Listeners\IrcMessageListener::class,
            \Raideer\Tweech\Listeners\ChatMessageListener::class,
        ];

        $this['client']->registerEventListener($coreListeners);
    }
550315
public function register()
  {
    $listeners = $this->app['config']->get('commander::listeners');
    $namespace = $this->app['config']->get('commander::listener_namespace');

    foreach($listeners as $listener)
    {
      $this->app['events']->listen($namespace . '.*', $listener);
    }
  }
327930
protected function listen()
    {
        $events = app('events');
        if (isset($this->listen)) {
            foreach ($this->listen as $event => $listeners) {
                foreach ($listeners as $listener) {
                    $events->listen($event, $listener);
                }
            }
        }
        
        if (isset($this->subscribe)) {
            foreach ($this->subscribe as $subscriber) {
                $events->subscribe($subscriber);
            }
        }
    }
231007
public function attachDefaultListeners()
    {
        parent::attachDefaultListeners();
        $events          = $this->getEventManager();
        $this->defaultListener->attach($events);
        return $this;
    }
1152608
public void addListeners()
    {
        super.addListeners();
        this.getMainRecord().getField(AnnivMaster.CALENDAR_CATEGORY_ID).addListener(new InitFieldHandler(this.getRecord(CalendarControl.CALENDAR_CONTROL_FILE).getField(CalendarControl.ANNIVERSARY_CATEGORY_ID)));
    }
385467
public void registerListenerExtensions() {
    if (listenerExtensionsRegistered) {
      throw H2O.fail("Listeners already registered");
    }

    long before = System.currentTimeMillis();
    ServiceLoader<H2OListenerExtension> extensionsLoader = ServiceLoader.load(H2OListenerExtension.class);
    for (H2OListenerExtension ext : extensionsLoader) {
      ext.init();
      listenerExtensions.put(ext.getName(), ext);
    }
    listenerExtensionsRegistered = true;
    registerListenerExtensionsMillis = System.currentTimeMillis() - before;
  }
577253
protected function registerListener()
	{
		$this->registerListenCommand();

		$this->app->singleton('queue.listener', function($app)
		{
			return new Listener($app->basePath());
		});
	}
744803
public void addListeners()
    {
        super.addListeners();
        this.getMainRecord().getField(Registration.RESOURCE_ID).addListener(new ReadSecondaryHandler(this.getRecord(Resource.RESOURCE_FILE)));
    }
1330031
protected function registerSwooleServerEvents()
    {
        $swooleListeners = SwooleListenerCollector::getCollector();

        if (!isset($swooleListeners[SwooleEvent::TYPE_SERVER]) || empty($swooleListeners[SwooleEvent::TYPE_SERVER])) {
            return;
        }

        $swooleServerListeners = $swooleListeners[SwooleEvent::TYPE_SERVER];
        $this->registerSwooleEvents($this->server, $swooleServerListeners);
    }