-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
loadString() behaviour #50
Comments
The check needs to stay in place because it creates a performance optimization to be able to overwrite the data store versus merging data. So the checks need to be improved. |
But right now the check is only in loadString, loadObject and loadArray call bind directly... |
That's part of the performance optimization. When a string is being loaded then internally converted to a So, again, the checks need to be improved. The short circuiting shouldn't be removed, and if it makes sense the short circuiting should be added to the other load methods (with the bug about the initialized flag not being set correctly based on your scenario being fixed). |
Steps to reproduce the issue
$config = new Registry;
$config->set('options', $someObj);
$config->loadFile($file);
Expected result
$someObj + data from file
Actual result
Only data from file since $this->initialized still is false after calling set method.
loadString has a check for $this->initialized and overwrites existing data that was set.
Is it intended that we have to call one of the load methods first to get $this->initialized set to true to get them merged or can we get rid of that if statement?
The text was updated successfully, but these errors were encountered: