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:
Woody Gilk 2009-03-09 09:54:56 +00:00
parent 658eac9e66
commit 66c31ce5dc
2 changed files with 13 additions and 2 deletions

View file

@ -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:
*

View file

@ -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;