protected function getSessionConfig(
        ServiceLocatorInterface $serviceLocator,
        $sessionConfig
    ) {
        if (empty($sessionConfig)
            || empty($sessionConfig['config'])
        ) {
            return new SessionConfig();
        }

        $class = '\Zend\Session\Config\SessionConfig';
        $options = [];

        if (isset($sessionConfig['config']['class'])
        ) {
            $class = $sessionConfig['config']['class'];
        }

        if (isset($sessionConfig['config']['options'])
        ) {
            $options = $sessionConfig['config']['options'];
        }

        /** @var \Zend\Session\Config\ConfigInterface $sessionConfigObject */
        if ($serviceLocator->has($class)) {
            $sessionConfigObject = $serviceLocator->get($class);
        } else {
            $sessionConfigObject = new $class();
        }

        if (!$sessionConfigObject instanceof ConfigInterface) {
            throw new InvalidArgumentException(
                'Session Config class must implement '
                . '\Zend\Session\Config\ConfigInterface'
            );
        }

        $sessionConfigObject->setOptions($options);

        return $sessionConfigObject;
    }
protected function getSessionConfig(
        ServiceLocatorInterface $serviceLocator,
        $sessionConfig
    ) {
        if (empty($sessionConfig)
            || empty($sessionConfig['config'])
        ) {
            return new SessionConfig();
        }

        $class = '\Zend\Session\Config\SessionConfig';
        $options = [];

        if (isset($sessionConfig['config']['class'])
        ) {
            $class = $sessionConfig['config']['class'];
        }

        if (isset($sessionConfig['config']['options'])
        ) {
            $options = $sessionConfig['config']['options'];
        }

        /** @var \Zend\Session\Config\ConfigInterface $sessionConfigObject */
        if ($serviceLocator->has($class)) {
            $sessionConfigObject = $serviceLocator->get($class);
        } else {
            $sessionConfigObject = new $class();
        }

        if (!$sessionConfigObject instanceof ConfigInterface) {
            throw new InvalidArgumentException(
                'Session Config class must implement '
                . '\Zend\Session\Config\ConfigInterface'
            );
        }

        $sessionConfigObject->setOptions($options);

        return $sessionConfigObject;
    }
protected function getSessionConfig ( ServiceLocatorInterface $ serviceLocator , $ sessionConfig ) { if ( empty ( $ sessionConfig ) || empty ( $ sessionConfig [ 'config' ] ) ) { return new SessionConfig ( ) ; } $ class = '\Zend\Session\Config\SessionConfig' ; $ options = [ ] ; if ( isset ( $ sessionConfig [ 'config' ] [ 'class' ] ) ) { $ class = $ sessionConfig [ 'config' ] [ 'class' ] ; } if ( isset ( $ sessionConfig [ 'config' ] [ 'options' ] ) ) { $ options = $ sessionConfig [ 'config' ] [ 'options' ] ; } /** @var \Zend\Session\Config\ConfigInterface $sessionConfigObject */ if ( $ serviceLocator -> has ( $ class ) ) { $ sessionConfigObject = $ serviceLocator -> get ( $ class ) ; } else { $ sessionConfigObject = new $ class ( ) ; } if ( ! $ sessionConfigObject instanceof ConfigInterface ) { throw new InvalidArgumentException ( 'Session Config class must implement ' . '\Zend\Session\Config\ConfigInterface' ) ; } $ sessionConfigObject -> setOptions ( $ options ) ; return $ sessionConfigObject ; }
Build the session config object

@param ServiceLocatorInterface $serviceLocator Zend Service Locator
@param array                   $sessionConfig  Session Config

@return \Zend\Session\Config\ConfigInterface|SessionConfig
@throws InvalidArgumentException
Build the session config object