Added Kohana::config() for loading Kohana_Config instances, and fixed Kohana_Config::load() to properly handle the reverse-ordered paths (can't use += append as it will merge in the wrong order
This commit is contained in:
parent
658eac9e66
commit
66c31ce5dc
|
@ -380,6 +380,17 @@ final class Kohana {
|
|||
return include $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new configuration object for the requested group.
|
||||
*
|
||||
* @param string group name
|
||||
* @param boolean enable caching
|
||||
*/
|
||||
public function config($group, $cache = TRUE)
|
||||
{
|
||||
return new Kohana_Config($group, $cache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides simple file-based caching for strings and arrays:
|
||||
*
|
||||
|
|
|
@ -28,8 +28,8 @@ class Kohana_Config_Core extends ArrayObject {
|
|||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
// Append each file to the configuration array
|
||||
$config += require $file;
|
||||
// Merge each file to the configuration array
|
||||
$config = array_merge($config, require $file);
|
||||
}
|
||||
|
||||
return $config;
|
||||
|
|
Loading…
Reference in a new issue