src/Synapse/Config/Config.php
public function load($groupName)
    {
        if (! count($this->readers)) {
            throw new \RuntimeException('No config readers attached');
        }

        if (! $groupName) {
            throw new \InvalidArgumentException('No config group specified');
        }

        if (! is_string($groupName)) {
            throw new \InvalidArgumentException('Config group must be a string');
        }

        if (isset($this->groups[$groupName])) {
            return $this->groups[$groupName];
        }

        $config = [];

        foreach ($this->readers as $reader) {
            if ($groupConfig = $reader->load($groupName)) {
                $config = array_replace_recursive($config, $groupConfig);
            }
        }

        $this->groups[$groupName] = $config;

        return $this->groups[$groupName];
    }
public function load($groupName)
    {
        if (! count($this->readers)) {
            throw new \RuntimeException('No config readers attached');
        }

        if (! $groupName) {
            throw new \InvalidArgumentException('No config group specified');
        }

        if (! is_string($groupName)) {
            throw new \InvalidArgumentException('Config group must be a string');
        }

        if (isset($this->groups[$groupName])) {
            return $this->groups[$groupName];
        }

        $config = [];

        foreach ($this->readers as $reader) {
            if ($groupConfig = $reader->load($groupName)) {
                $config = array_replace_recursive($config, $groupConfig);
            }
        }

        $this->groups[$groupName] = $config;

        return $this->groups[$groupName];
    }
public function load ( $ groupName ) { if ( ! count ( $ this -> readers ) ) { throw new \ RuntimeException ( 'No config readers attached' ) ; } if ( ! $ groupName ) { throw new \ InvalidArgumentException ( 'No config group specified' ) ; } if ( ! is_string ( $ groupName ) ) { throw new \ InvalidArgumentException ( 'Config group must be a string' ) ; } if ( isset ( $ this -> groups [ $ groupName ] ) ) { return $ this -> groups [ $ groupName ] ; } $ config = [ ] ; foreach ( $ this -> readers as $ reader ) { if ( $ groupConfig = $ reader -> load ( $ groupName ) ) { $ config = array_replace_recursive ( $ config , $ groupConfig ) ; } } $ this -> groups [ $ groupName ] = $ config ; return $ this -> groups [ $ groupName ] ; }
Load configuration for a group

@param  string $groupName
@return array
Load configuration for a group