Skip to content

Commit

Permalink
merge configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
keywan-ghadami-oxid authored Jul 29, 2016
1 parent 000346c commit 3131698
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions source/MonologFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@ function __construct($vars){

protected $loggerRegistry = [];
protected function loadMonologConfig($vars)
{
{
$path = $vars['monolog_config_dir'] . '/monolog.dist.yaml';
$dist = [];
if(file_exists($path)){
$dist = Yaml::parse(file_get_contents($path))
}
$path = $vars['monolog_config_dir'] . '/monolog.yaml';
if(!file_exists($path)){
$path = $vars['monolog_config_dir'] . '/monolog.dist.yaml';
$custom = [];
if(file_exists($path)){
$custom = Yaml::parse(file_get_contents($path));
}
//Do not try catch parse erors because the system should
// not continue to work until the configuration is fixed
return Yaml::parse(file_get_contents($path));

$res = array_merge($dist,$custom);
return $res;
}

private function isList(array $arr)
Expand Down

0 comments on commit 3131698

Please sign in to comment.