Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge config files using array_replace_recursive #757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Merge config files using array_replace_recursive #757

wants to merge 1 commit into from

Conversation

radmen
Copy link
Contributor

@radmen radmen commented Mar 29, 2013

Probably it's related with (#709).

Config merge was replacing nested arrays. This PR makes Config to replace only specified values.

@taylorotwell
Copy link
Member

This is actually not desirable. For example:

Main Config:

'foo' => array('foo', 'bar');

Env Config:

'foo' => array('baz');

You might intend to replace the entire array, but you will actually up with a 3 element array of "foo", "bar", and "baz. That is why configs are not recursively merged. It causes problems.

@radmen
Copy link
Contributor Author

radmen commented Mar 30, 2013

I'm now using something similar in my old framework. Such situation didn't occur but I get the point. Thx for info!

@taylorotwell
Copy link
Member

No problem.

@taylorotwell
Copy link
Member

Just revisiting this. I was wrong before. This is now implemented.

@radmen
Copy link
Contributor Author

radmen commented May 8, 2013

Cool, thanks!

valorin added a commit to valorin/laravel-framework that referenced this pull request Aug 23, 2014
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.
gonzalom pushed a commit to Hydrane/tmp-laravel-framework that referenced this pull request Oct 12, 2023
…-from-test-event-mock

Add `dispatch` method as a mock to the Event Dispatcher in `TestCase`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants