forked from silverstripe/silverstripe-framework
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API Allow for different merge strategies in config
Added ability to provide custom classes for handling the 'merge' of yaml config fragments other than the default 'merge' strategy Reimplemented merge_array_high_into_low so that it doesn't perform the swapping of src and dest arrays when merging values, in such a way that it obeys correct ordering of element arrays as required. Added assertions for ConfigManifestTest Updated configuration docs Fixed issue where merges of high_into_low wouldn't maintain the 'high' array's key order when merged into the lower array - the keys would be swapped in order so an associative array_splice was used to continually splice the associative data into place. Keep merge strategy management in the ConfigManifest as they're only applicable to yaml configuration, and removed the rules from merge_low_into_high as they're not applicable for this either.
- Loading branch information
Showing
5 changed files
with
277 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance of this making it into a pull request?
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Word from Sam was "don't do anything that makes the config system slower". This could be re-worked and pulled against master, but it's probably too late now for 3.1. It'll likely need rewriting though after I've finished the change needed to make Environment rule support work.
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick response Hamish,
I think that's ok... it's really just a nice to have for now, but I'd like to see something along these lines make it into master in the long term.
Is there a temporary workaround for developers who want to have an overridable default value that's an array type? (that can be replaced via yaml instead of merged)
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump for status update? Now that 3.1 is forcing people into using the config system more and more (finally :)) it's becoming more and more necessary to be able to override config settings
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump again - very keen to have this in core...
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump, too. I think the very cool way, configuring SilverStripe via yaml gets unnecessarily unattractive when the word is "but replacing arrays you have to do in your old _config.php, Dude". So give it a chance. 👍
b871872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately there's moderate a performance impact with it just as it is. We're hopefully going to include some config system performance improvements in 3.2 which amongst other things will eliminate that performance cost, so we can include it in that work.