Implements: Kohana_Config_Source | Kohana_Config_Reader
File-based configuration reader. Multiple configuration directories can be used by attaching multiple instances of this class to Config.
Class declared in SYSPATH/classes/kohana/config/file.php on line 12.
string
$_directoryThe directory where config files are located
Creates a new file reader using the given directory as a config source
string
$directory
= string(6) "config" - Configuration directory to searchpublic function __construct($directory = 'config')
{
// Set the configuration directory name
$this->_directory = trim($directory, '/');
}
Load and merge all of the configuration files in this group.
$config->load($name);
string
$group
required - Configuration group name$this
- Current objectpublic function load($group)
{
$config = array();
if ($files = Kohana::find_file($this->_directory, $group, NULL, TRUE))
{
foreach ($files as $file)
{
// Merge each file to the configuration array
$config = Arr::merge($config, Kohana::load($file));
}
}
return $config;
}