Load the given configuration group.

@param string $group
@param string $namespace

@return array
170853
public function load($group, $namespace = null)
    {
        $items = [];

        $path = $this->getPath($namespace);

        if (is_null($path)) {
            return $items;
        }

        $file = "{$path}/{$group}.php";

        if ($this->files->exists($file)) {
            $items = $this->getRequire($file);
        }

        return $items;
    }
371093
protected function update($namespace, $config) {
		foreach ($config as $k => $v) {
			if (strpos($k, '.') === false) {
				$this->cache[$namespace][$k] = $v;
				continue;
			}
			$keys = explode('.', $k);
			$total = count($keys) - 1;
			$parent = &$this->cache[$namespace];
			foreach ($keys as $kk => $vv) {
				if ($total === $kk) {
					$parent[$vv] = $v;
				} else {
					if (!isset($parent[$vv])) {
						$parent[$vv] = [];
					}
					$parent = &$parent[$vv];
				}
			}
		}
	}
694477
protected function loadDataForPrefix($namespace, $prefix)
    {
        $this->failOnMissingNamespace($namespace);

        if (!isset($this->cachedData[$namespace])) {
            $this->cachedData[$namespace] = [];
        }

        if (!isset($this->cachedData[$namespace][$prefix])) {
            $this->cachedData[$namespace][$prefix] = [];
        }

        foreach ($this->addedData[$namespace] as $data) {

            if (isset($data[$prefix])) {
                $this->cachedData[$namespace][$prefix][] = $data[$prefix];
            }
        }

        return $this->cachedData[$namespace][$prefix];
    }
243244
protected function loadGlobal(/*# string */ $group)
    {
        if (!isset($GLOBALS[$group])) {
            $this->throwError(
                Message::get(Message::CONFIG_GLOBAL_UNKNOWN, $group),
                Message::CONFIG_GLOBAL_UNKNOWN
            );
        }

        // load super global
        $this->config->addNode($group, $GLOBALS[$group]);

        return $this;
    }
142008
public function getItems($locale, $namespace, $group)
    {
        return $this->model
            ->whereLocale($locale)
            ->whereNamespace($namespace)
            ->whereGroup($group)
            ->get()
            ->toArray();
    }
1169878
protected function loadViewsFrom($path, $namespace)
    {
        if (is_array($this->app->config['view']['paths'])) {
            foreach ($this->app->config['view']['paths'] as $viewPath) {
                if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) {
                    $this->app['view']->addNamespace($namespace, $appPath);
                }
            }
        }

        $this->app['view']->addNamespace($namespace, $path);
    }
525659
private function createGroups(array $namespaces)
    {
        $groups = [];

        foreach ($this->groups as $group) {
            if (is_array($group)) {
                $groups[] = array_fill_keys($group, []);
            } else {
                $groups[$group] = [];
            }
        }

        if (!array_key_exists('_main', $groups)) {
            $groups = array_merge(
                ['_main' => []],
                $groups
            );
        }

        foreach ($namespaces as $namespace) {
            foreach ($groups as $groupKey => $group) {
                if (is_int($groupKey)) {
                    foreach ($group as $subGroupKey => $subGroup) {
                        if (strpos($namespace, $subGroupKey) === 0) {
                            array_push($groups[$groupKey][$subGroupKey], $namespace);

                            continue 3;
                        }
                    }
                } elseif (is_string($groupKey) && strpos($namespace, $groupKey) === 0) {
                    array_push($groups[$groupKey], $namespace);

                    continue 2;
                }
            }

            array_push($groups['_main'], $namespace);
        }

        return $groups;
    }
240405
public function load($group = null, $index = false, $reload = true)
	{

		if (is_array($group)) {
			// Loading multiple config groups
			foreach ($group as $g) {
				$this->load($g, $index);
			}
		} else {

			if (empty($group)) {
				$group = 'default';
			}
			if ($index === true) {
				$index_group = $group;
			} else {
				$index_group = 'default';
			}
			if (!$reload && array_key_exists($group, $this->items)) {
				return $this->items[$group];
			}

			// First, grab any default items.
			$default_items = $this->provider->load($group);

			// Next, grab any environment-specific items.
			$environment_items = $this->provider->load($group, $this->environment);

			// Merge them together. Environment-specific items will replace default items.
			$items = self::array_merge_deep($default_items, $environment_items);

			// Add this config group to our index.
			foreach ($items as $key => $value) {
				$this->set($key, $value, $index_group);
			}

			// Return the items loaded in this call, NOT ALL the items in the config array.
			return $items;
		}
	}
1193561
protected function getLine($namespace, $group, $locale, $item, array $replace)
    {
        $this->load($namespace, $group, $locale);

        $line = static::arrayGet($this->loaded[$namespace][$group][$locale], $item);

        if (is_string($line)) {
            return $this->makeReplacements($line, $replace);
        } elseif (is_array($line) && count($line) > 0) {
            return $line;
        }
    }
316992
public static function getKeys($group)
    {
        self::loadKeys();
        self::$keys[$group] = isset(self::$keys[$group]) ? self::$keys[$group] : [];

        return self::$keys[$group];
    }
852494
protected function read($namespace, $group, $locale, $item)
	{
		$this->load($namespace, $group, $locale);

		$data = Arr::get($this->loaded[$namespace][$group][$locale], $item);

		return $data;
	}
440492
protected function resolveRouteGroupAttributes($namespace = null, array $attributes = [])
    {
        if (is_array($namespace)) {
            $attributes = $namespace;
            $namespace  = '';
        }
        if (!is_null($namespace)) {
            $attributes['namespace'] = empty($namespace) ? $this->namespace : "{$this->namespace}\\{$namespace}";
        }
        return $attributes;
    }
459465
public function ns($nameSpace)
    {
        // If ! exist try to load a configuration file 
        if ( !isset($this->nameSpaces[$nameSpace]) ) {
            // short sanitize of nameSpace
            if (!filter_var( $nameSpace,FILTER_VALIDATE_REGEXP, 
                array('options'=>array('regexp' => '/^[\w]+$/')))) {
                    throw new InvalidArgumentException("Invalid configuration name.",400);
            }
            $this->nameSpaces[$nameSpace] = new ContextNameSpace($this->loadArrayFromIniFile($nameSpace));
        }
        
        return $this->nameSpaces[$nameSpace];
    }
857157
protected function loadConstantsFrom($path, $namespace = null)
    {
        $constants = require $path;
        $prefix = $namespace ? "$namespace" : '';

        foreach ($constants as $constant => $value) {
            define(strtoupper("{$prefix}{$constant}"), $value);
        }
    }
134687
public function add($alias, array $namespace)
    {
        $alias = Input::checkAlias($alias);
        $props = $this->getNamespace($alias, true);

        foreach ($namespace as $ns) {
            $group = $this->getNamespaceGroup($ns);

            if ('any' === $group) {
                $props = ['any' => true];
                break;
            } else {
                // trim trailing * from path pattern
                $ns = 'path' === $group ? rtrim($ns, '*') : $ns;
                $props[$group][] = $ns;
            }
        }

        $this->setNamespace($alias, $props);
    }
482161
public static function config($namespace)
    {
        $configPath = pluginsPath($namespace.'/config.json');
        if(file_exists($configPath)) {
            return json_decode(File::get($configPath));
        }
        throw  new \Exception("No config.json file found for plugin ".$configPath);
    }
733098
protected function parsePackageSegments($key, $namespace, $item)
    {
        $itemSegments = explode('.', $item);

        // If the configuration file doesn't exist for the given package group we can
        // assume that we should implicitly use the config file matching the name
        // of the namespace. Generally packages should use one type or another.
        if (! $this->getLoader()->exists($itemSegments[0], $namespace)) {
            return [$namespace, 'config', $item];
        }

        return parent::parseNamespacedSegments($key);
    }