src/Service/Config.php
public function getByKey($key = null)
    {
        if (!array_key_exists($key, $this->applicationMap)) {
            $this->applicationMap[$key] = array();
            $config = $this->serviceManager->get('Config');
            $appConfig = $this->serviceManager->get('ApplicationConfig');
            foreach ($appConfig['modules'] as $module) {
                if (array_key_exists($module, $config)) {
                    if (array_key_exists($key, $config[$module])) {
                        // The strtolower is essential for later retrieving
                        // namespaces in the repositories
                        // anyway, it's easier to agree everything should be lowercase
                        $this->applicationMap[$key][strtolower($module)] = $config[$module][$key];
                    }
                }
            }
        }
        return $this->applicationMap[$key];
    }
public function getByKey($key = null)
    {
        if (!array_key_exists($key, $this->applicationMap)) {
            $this->applicationMap[$key] = array();
            $config = $this->serviceManager->get('Config');
            $appConfig = $this->serviceManager->get('ApplicationConfig');
            foreach ($appConfig['modules'] as $module) {
                if (array_key_exists($module, $config)) {
                    if (array_key_exists($key, $config[$module])) {
                        // The strtolower is essential for later retrieving
                        // namespaces in the repositories
                        // anyway, it's easier to agree everything should be lowercase
                        $this->applicationMap[$key][strtolower($module)] = $config[$module][$key];
                    }
                }
            }
        }
        return $this->applicationMap[$key];
    }
public function getByKey ( $ key = null ) { if ( ! array_key_exists ( $ key , $ this -> applicationMap ) ) { $ this -> applicationMap [ $ key ] = array ( ) ; $ config = $ this -> serviceManager -> get ( 'Config' ) ; $ appConfig = $ this -> serviceManager -> get ( 'ApplicationConfig' ) ; foreach ( $ appConfig [ 'modules' ] as $ module ) { if ( array_key_exists ( $ module , $ config ) ) { if ( array_key_exists ( $ key , $ config [ $ module ] ) ) { // The strtolower is essential for later retrieving // namespaces in the repositories // anyway, it's easier to agree everything should be lowercase $ this -> applicationMap [ $ key ] [ strtolower ( $ module ) ] = $ config [ $ module ] [ $ key ] ; } } } } return $ this -> applicationMap [ $ key ] ; }
fetch the settings for a certain key of all Modules
@param string $key
@return array
fetch the settings for a certain key of all Modules