public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $mm = $serviceLocator->get('ModuleManager');
        $mm->loadModules();
        $moduleParams = $mm->getEvent()->getParams();

        $config = ArrayUtils::merge(
            $moduleParams['configListener']->getMergedConfig(false),
            $serviceLocator->get('ApplicationConfig')
        );

        $parametersBag = $serviceLocator->get('ApplicationParameters');

        $config['parameters'] = isset($config['parameters']) ?
            ArrayUtils::merge($parametersBag->all(), $config['parameters']) :
            $config['parameters'] = $parametersBag->all();

        return $parametersBag->resolveArray($config);
    }
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $mm = $serviceLocator->get('ModuleManager');
        $mm->loadModules();
        $moduleParams = $mm->getEvent()->getParams();

        $config = ArrayUtils::merge(
            $moduleParams['configListener']->getMergedConfig(false),
            $serviceLocator->get('ApplicationConfig')
        );

        $parametersBag = $serviceLocator->get('ApplicationParameters');

        $config['parameters'] = isset($config['parameters']) ?
            ArrayUtils::merge($parametersBag->all(), $config['parameters']) :
            $config['parameters'] = $parametersBag->all();

        return $parametersBag->resolveArray($config);
    }
public function createService ( ServiceLocatorInterface $ serviceLocator ) { $ mm = $ serviceLocator -> get ( 'ModuleManager' ) ; $ mm -> loadModules ( ) ; $ moduleParams = $ mm -> getEvent ( ) -> getParams ( ) ; $ config = ArrayUtils :: merge ( $ moduleParams [ 'configListener' ] -> getMergedConfig ( false ) , $ serviceLocator -> get ( 'ApplicationConfig' ) ) ; $ parametersBag = $ serviceLocator -> get ( 'ApplicationParameters' ) ; $ config [ 'parameters' ] = isset ( $ config [ 'parameters' ] ) ? ArrayUtils :: merge ( $ parametersBag -> all ( ) , $ config [ 'parameters' ] ) : $ config [ 'parameters' ] = $ parametersBag -> all ( ) ; return $ parametersBag -> resolveArray ( $ config ) ; }
Create the application configuration service.

Retrieves the Module Manager from the service locator, and executes
{@link Zend\ModuleManager\ModuleManager::loadModules()}.

It then retrieves the config listener from the module manager, and from
that the merged configuration.

@param ServiceLocatorInterface $serviceLocator

@return array|\Traversable
Create the application configuration service .