Implements: Kohana_Config_Source | Kohana_Config_Reader
This class is a transparent base class for Config_File and should not be accessed directly.
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 13.
string
$_directoryThe directory where config files are located
string(0) ""
Creates a new file reader using the given directory as a config source
string
$directory
= string(6) "config" - Configuration directory to search public 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 = [];
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;
}