Implements: Kohana_Config_Reader | Kohana_Config_Source
File-based configuration reader. Multiple configuration directories can be used by attaching multiple instances of this class to Config.
Class declared in SYSPATH/classes/config/file.php on line 3.
string
$_directorylink to thisThe 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 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 object
public
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
;
}