Skip to content

Commit

Permalink
allow to inject $localConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejsstepanovs committed Dec 23, 2015
1 parent 68fa8f5 commit c190844
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@
require 'vendor/autoload.php';

$configPath = __DIR__ . '/config';

if (!isset($localConfig)) {
if (file_exists($configPath . '/config.local.php')) {
$localConfig = include $configPath . '/config.local.php';
} else {
$localConfig = [];
}
}

$configData = include $configPath . '/config.php';
if (file_exists($configPath . '/config.local.php')) {
$localConfig = include $configPath . '/config.local.php';
if (!empty($localConfig)) {
$configData = array_replace_recursive($configData, $localConfig);
}

Expand Down

0 comments on commit c190844

Please sign in to comment.