Listen to the bootstrap event

@param EventInterface $e
@return array
2962
public function onBootstrap(EventInterface $e)
    {
        /** @var EventManagerInterface $eventManager */
        $eventManager = $e->getApplication()->getEventManager();
        $eventManager->attach(MvcEvent::EVENT_RENDER, function (MvcEvent $event) {
            /** @var HelperPluginManager $viewHelperManager */
            $viewHelperManager = $event->getApplication()->getServiceManager()->get('ViewHelperManager');
            /** @var BasePath $basePath */
            $basePath = $viewHelperManager->get('basePath');
            $viewHelperManager->get('inlineScript')->prependFile($basePath() . '/js/kmb.cache.js');
        });
    }
634212
protected function getEventListeners($eventName)
    {
        $results = [];

        foreach ($this->eventDispatcher->getListeners($eventName) as $listener) {
            if ($listener instanceof \Closure) {
                $results[] = '{closure}()';
            } elseif (\is_object($listener[0])) {
                $results[] = \get_class($listener[0]);
            } elseif (\is_string($listener[0])) {
                $results[] = $listener[0];
            } else {
                $results[] = 'Unknown type!';
            }
        }

        return $results;
    }
679906
public function onBootstrap($e)
    {
        $eventManager   = $e->getApplication()->getEventManager();
        $serviceManager = $e->getApplication()->getServiceManager();
        $options        = $serviceManager->get('dlcdoctrine_module_options');
        
        if ($options->getEnableAutoFlushFinishListener()) {
            $serviceManager->get('dlcdoctrine_event_finishlistener')
                           ->attach($eventManager);
        }
    }
15203
public function getListenersForEvent($eventClassName)
    {
        if (FALSE === array_key_exists($eventClassName, $this->eventMap))
        {
            return [];
        }
        return $this->eventMap[$eventClassName];
    }
597850
public function listeners($event): array
    {
        $name = \get_class($event);

        $localListeners  = $this->events[$name] ?? [];
        $globalListeners = static::$globalEvents[$name] ?? [];

        return array_merge($globalListeners, $localListeners);
    }
316771
public function handle(EventInterface $event)
    {
        $events = array_filter($this->listener, function (string $eventName) use ($event): bool {
            return fnmatch($eventName, $event->getName());
        }, ARRAY_FILTER_USE_KEY);

        $events = array_reduce($events, 'array_merge', []);

        array_walk(
            $events,
            /**
             * @param mixed $item
             * @return void
             */
            function ($item) use ($event) {
                if ($item instanceof ListenerInterface) {
                    $item->handle($event);

                    return;
                }
                if (\is_callable($item)) {
                    $item($event);
                }
            }
        );
    }
1096900
public function getListeners($event): array
    {
        if ($event instanceof EventInterface) {
            $event = $event->getName();
        }

        if (isset($this->listeners[$event])) {
            return $this->listeners[$event]->getAll();
        }

        return [];
    }
596266
public function onBootstrap(EventInterface $e)
    {
        $application  = $e->getApplication();
        $eventManager = $application->getEventManager();
        $services     = $application->getServiceManager();

        $services->get('Install/Listener/LanguageSetter')
                 ->attach($eventManager);

        // start tracy debugging
        $services->get('Tracy')->startDebug();
    }
885377
public function handleDbEvent($e) {
    $statement = $e->getParam('statement', null);
    if ($statement != null) {
      $this->statements[] = [$statement->getSql(), $statement->getParameterContainer()->getNamedArray()];
    }
  }
775866
public function trigger(EventInterface $event, array $args = []){
        return call_user_func_array($this->callback, array_merge([$event], $args));
    }
1235138
public function getListeners(string $eventName) : array
    {
        if (!isset($this->events[$eventName])) {
            return [];
        }

        return $this->events[$eventName];
    }
520729
public function resolveObjectSelectTargetClass($e)
    {
        $elementSpec = $e->getParam('elementSpec');
        if (!isset($elementSpec['spec']['type'])) {
            return;
        }

        $type = $elementSpec['spec']['type'];
        if (strtolower($type) !== 'objectselect' && !$type instanceof ObjectSelect) {
            return;
        }

        if (isset($elementSpec['spec']['options']['target_class']) &&
            class_exists($elementSpec['spec']['options']['target_class']) ||
            empty($formSpec['object'])
        ) {
            return;
        }

        $formSpec = $e->getParam('formSpec');
        $metadata = $this->objectManager->getClassMetadata($formSpec['object']);

        if ($metadata->hasAssociation($elementSpec['spec']['name'])) {
            $elementSpec['spec']['options']['target_class'] =
                $metadata->getAssociationTargetClass($elementSpec['spec']['name']);
        }
    }
640390
public function loadBootstrap( SuiteEvent $e ) {
		$settings = $e->getSettings();
		if ( ! isset( $settings['bootstrap'] ) || ! filter_var( $settings['bootstrap'], FILTER_VALIDATE_BOOLEAN ) ) {
			return;
		}

		$bootstrap = $settings['path'] . $settings['bootstrap'];
		if ( ! is_file( $bootstrap ) ) {
			throw new ConfigurationException( "Bootstrap file {$bootstrap} can't be loaded" );
		}

		require_once $bootstrap;
	}
565651
public function onBootstrap($e)
    {
        $sm = $e->getApplication()->getServiceManager();
        $config = $sm->get('acplolog_options');

        if ($config->getUseErrorLogger()) {
            $logger = $sm->get('AcploLog\Log\ErrorLogger');

            $eventManager = $e->getApplication()->getEventManager();
            $eventManager->attach(\Zend\Mvc\MvcEvent::EVENT_DISPATCH_ERROR, [
                $logger,
                'dispatchError',
            ], - 100);
        }

        if ($config->getUseSqlLogger()) {
            $em = $sm->get('doctrine.entitymanager.orm_default');
            $sqlLogger = $sm->get('AcploLog\Log\SqlLogger');
            $sqlLogger->addLoggerTo($em);
        }
    }
274190
public function listenersOfEvent(Event $event)
    {
        $event_name = get_class($event);

        return isset($this->listeners[$event_name]) ? $this->listeners[$event_name] : [];
    }
1155145
public function onBootstrap(EventInterface $e)
    {
        if (!$e instanceof MvcEvent) {
            $errMsg = sprintf('Event not implement %s', MvcEvent::class);
            throw new Exception\InvalidArgumentException($errMsg);
        }

        $app = $e->getApplication();

        $eventManager        = $app->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        $sl = $app->getServiceManager();
        /** @var ParamsFromDoctrineModuleListener $paramsFromDoctrineModuleListener */
        $paramsFromDoctrineModuleListener = $sl->get(ParamsFromDoctrineModuleListener::class);
        $paramsFromDoctrineModuleListener->attach($eventManager);


        /** @var ResolverManagerRegistryResourceListener $resolverManagerRegistryResourceListener */
        $resolverManagerRegistryResourceListener = $sl->get(ResolverManagerRegistryResourceListener::class);
        $resolverManagerRegistryResourceListener->attach($eventManager);

        /** @var ManagerRegistryListener $managerRegistryListener */
        $managerRegistryListener = $sl->get(ManagerRegistryListener::class);
        $managerRegistryListener->attach($eventManager);

    }
952273
public function subscribe(EventInterface $event) {
        $events = [];

        // Enable the event listener only for resources and methods specified
        foreach ($this->params['allowedMethods'] as $resource => $methods) {
            foreach ($methods as $method) {
                $eventName = $resource . '.' . strtolower($method);
                $events[$eventName] = ['invoke' => 1000];
            }

            // Always enable the listener for the OPTIONS method
            $eventName = $resource . '.options';
            $events[$eventName] = ['options' => 20];
        }

        $manager = $event->getManager();
        $manager->addCallbacks($event->getHandler(), $events);

        // Add OPTIONS to the Allow header
        $event->getResponse()->headers->set('Allow', 'OPTIONS', false);
    }