Closed electricjones closed 9 years ago
Added to develop
branch
I am not sure how I missed this issue. But I did. Does something still need to be done? Sort of confused by the "Added to develop branch" comment.
Scott
No it was super simple. Only took me a few minutes. Thanks though :)
There is a potential flaw in the way the
FileLoader
constructs its array data atm. If two files are loaded and share some key, whichever is loaded last overwrites the first. There should be a way around this, and it should probably not do this by default.To be clear, this is not the same as #34.
This is what I mean. hello.json
world.php
In this case, world.php overwrites hello.json.
Possible Fixes
There are a couple options to correct this. 1 Auto namespace items based on (sanitized) filename
hello.json
world.php
2 Give the user the ability to decide a namespace
Which would namespace each file under that particular namespace.
3 A combination of both would probably be best
hello.json
world.php
Things to be aware of
From here
I'd like to do some research into Laravel, Symfony, and Yii. I know they all do this and have used all three, but never noticed how they handle this little issue. Any other thoughts are welcome.