Skip to content

Commit

Permalink
Fixing cascade behaviour for package config.
Browse files Browse the repository at this point in the history
Normal configs were cascading with array_replace_recursive(), which
merged recursive arrays nicely, however Package configs were using
array_merge(), which only merged the top-level arrays. This is
inconsistent across the configuration handling, and is confusing for
users trying to override specific package configuration.

It looks like this fix was proposed in Issue laravel#757, but missed when the
Issue laravel#1225 was proposed, considered a duplicate, and eventually
merged.
  • Loading branch information
valorin committed Aug 23, 2014
1 parent dbe372d commit 5e7e0ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Config/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function cascadePackage($env, $package, $group, $items)

if ($this->files->exists($path = $this->defaultPath.'/'.$file))
{
$items = array_merge($items, $this->getRequire($path));
$items = array_replace_recursive($items, $this->getRequire($path));
}

// Once we have merged the regular package configuration we need to look for
Expand All @@ -169,7 +169,7 @@ public function cascadePackage($env, $package, $group, $items)

if ($this->files->exists($path))
{
$items = array_merge($items, $this->getRequire($path));
$items = array_replace_recursive($items, $this->getRequire($path));
}

return $items;
Expand Down

0 comments on commit 5e7e0ff

Please sign in to comment.