Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #7 from xtreamwayz/hotfix/config-loader
Browse files Browse the repository at this point in the history
Use zend-stdlib for autoload config
  • Loading branch information
weierophinney committed Oct 13, 2015
2 parents 9a7af33 + c103f53 commit 1c1ad81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
],
"require": {
"roave/security-advisories": "dev-master",
"zendframework/zend-expressive": "^0.5"
"zendframework/zend-expressive": "^0.5",
"zendframework/zend-stdlib": "~2.7"
},
"require-dev": {
"composer/composer": ">=1.0.0-alpha10",
Expand Down
7 changes: 5 additions & 2 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\Glob;

/**
* Configuration files are loaded in a specific order. First ``global.php`` and afterwards ``local.php``. This way
* local settings overwrite global settings.
Expand All @@ -20,8 +23,8 @@
$config = json_decode(file_get_contents($cachedConfigFile), true);
} else {
// Load configuration from autoload path
foreach (glob('config/autoload/{{,*.}global,{,*.}local}.php', GLOB_BRACE) as $file) {
$config = array_replace_recursive($config, include $file);
foreach (Glob::glob('config/autoload/{{,*.}global,{,*.}local}.php', Glob::GLOB_BRACE) as $file) {
$config = ArrayUtils::merge($config, include $file);
}

// Cache config if enabled
Expand Down

0 comments on commit 1c1ad81

Please sign in to comment.