mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-23 23:04:32 +03:00
Make sure appropriate defaults for omitted configs are used
This commit is contained in:
parent
aa0c213cc3
commit
5363698020
@ -33,13 +33,19 @@ function load_system_configs()
|
||||
if (is_null($configs)) {
|
||||
$parser = new YamlParser();
|
||||
$configs = $parser->parse(file_get_contents(MIBEW_FS_ROOT . '/configs/config.yml'));
|
||||
$configs += array(
|
||||
// Mailer configs are not necessary and can be omited but the
|
||||
// section must exist anyway.
|
||||
'mailer' => array(),
|
||||
// Cache section must extst too.
|
||||
'cache' => array(),
|
||||
);
|
||||
|
||||
// Mailer configs are not necessary and can be omited but the section
|
||||
// must exist anyway. Empty statement is used to make sure null, false
|
||||
// and "" will be converted to an empty array.
|
||||
if (empty($configs['mailer'])) {
|
||||
$configs['mailer'] = array();
|
||||
}
|
||||
|
||||
// Cache section must extst too. The logic behind "empty" statement is
|
||||
// the same as above.
|
||||
if (empty($configs['cache'])) {
|
||||
$configs['cache'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
return $configs;
|
||||
|
Loading…
Reference in New Issue
Block a user