public function onBootstrap(MvcEvent $event)
    {
        $serviceManager = $event->getApplication()->getServiceManager();

        $request = $serviceManager->get('request');

        if ($request instanceof ConsoleRequest) {
            return;
        }

        //Add Domain Checker
        $eventWrapper = $serviceManager->get(
            \Rcm\EventListener\EventWrapper::class
        );

        /** @var \Zend\EventManager\EventManager $eventManager */
        $eventManager = $event->getApplication()->getEventManager();

        // Check for redirects from the CMS
        $eventManager->attach(
            MvcEvent::EVENT_ROUTE,
            [$eventWrapper, 'routeEvent'],
            10000
        );

        // Set the sites layout.
        $eventManager->attach(
            MvcEvent::EVENT_DISPATCH,
            [$eventWrapper, 'dispatchEvent'],
            10000
        );

        // Set the custom http response checker
        $eventManager->attach(
            MvcEvent::EVENT_FINISH,
            [$eventWrapper, 'finishEvent'],
            10000
        );

        $viewEventManager = $serviceManager->get('ViewManager')
            ->getView()
            ->getEventManager();

        // Set the plugin response over-ride
        $viewEventManager->attach(
            ViewEvent::EVENT_RESPONSE,
            [$eventWrapper, 'viewResponseEvent'],
            -10000
        );

        // Use the configured session handler.
        // Should we really boot this for every request though?
        $serviceManager->get(\Rcm\Service\SessionManager::class)->start();
    }
public function onBootstrap(MvcEvent $event)
    {
        $serviceManager = $event->getApplication()->getServiceManager();

        $request = $serviceManager->get('request');

        if ($request instanceof ConsoleRequest) {
            return;
        }

        //Add Domain Checker
        $eventWrapper = $serviceManager->get(
            \Rcm\EventListener\EventWrapper::class
        );

        /** @var \Zend\EventManager\EventManager $eventManager */
        $eventManager = $event->getApplication()->getEventManager();

        // Check for redirects from the CMS
        $eventManager->attach(
            MvcEvent::EVENT_ROUTE,
            [$eventWrapper, 'routeEvent'],
            10000
        );

        // Set the sites layout.
        $eventManager->attach(
            MvcEvent::EVENT_DISPATCH,
            [$eventWrapper, 'dispatchEvent'],
            10000
        );

        // Set the custom http response checker
        $eventManager->attach(
            MvcEvent::EVENT_FINISH,
            [$eventWrapper, 'finishEvent'],
            10000
        );

        $viewEventManager = $serviceManager->get('ViewManager')
            ->getView()
            ->getEventManager();

        // Set the plugin response over-ride
        $viewEventManager->attach(
            ViewEvent::EVENT_RESPONSE,
            [$eventWrapper, 'viewResponseEvent'],
            -10000
        );

        // Use the configured session handler.
        // Should we really boot this for every request though?
        $serviceManager->get(\Rcm\Service\SessionManager::class)->start();
    }
public function onBootstrap ( MvcEvent $ event ) { $ serviceManager = $ event -> getApplication ( ) -> getServiceManager ( ) ; $ request = $ serviceManager -> get ( 'request' ) ; if ( $ request instanceof ConsoleRequest ) { return ; } //Add Domain Checker $ eventWrapper = $ serviceManager -> get ( \ Rcm \ EventListener \ EventWrapper :: class ) ; /** @var \Zend\EventManager\EventManager $eventManager */ $ eventManager = $ event -> getApplication ( ) -> getEventManager ( ) ; // Check for redirects from the CMS $ eventManager -> attach ( MvcEvent :: EVENT_ROUTE , [ $ eventWrapper , 'routeEvent' ] , 10000 ) ; // Set the sites layout. $ eventManager -> attach ( MvcEvent :: EVENT_DISPATCH , [ $ eventWrapper , 'dispatchEvent' ] , 10000 ) ; // Set the custom http response checker $ eventManager -> attach ( MvcEvent :: EVENT_FINISH , [ $ eventWrapper , 'finishEvent' ] , 10000 ) ; $ viewEventManager = $ serviceManager -> get ( 'ViewManager' ) -> getView ( ) -> getEventManager ( ) ; // Set the plugin response over-ride $ viewEventManager -> attach ( ViewEvent :: EVENT_RESPONSE , [ $ eventWrapper , 'viewResponseEvent' ] , - 10000 ) ; // Use the configured session handler. // Should we really boot this for every request though? $ serviceManager -> get ( \ Rcm \ Service \ SessionManager :: class ) -> start ( ) ; }
Bootstrap For RCM.

@param MvcEvent $event Zend MVC Event

@return void
Bootstrap For RCM .