Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for custom presets #370
Comments
|
|
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up|
|
Right now we can create custom configuration based on presets, however I think it would be worth allowing custom presets also.
This would mean opening up the
Presetinterface so for example a framework could maintain their own Preset file and users can then use the preset, just by pointing their preset configuration to the class.Implementation
Configuration::resolveConfig, theOptionsResolvernow has to allowpresetto also be a valid class.ConfigResolver::resolve, add a new private methodresolvePreset, which has the current logic for resolving a preset, but also adds support for the preset variable could be a class fqn.ConfigResolverTestfor setting preset from a classPresetinterfaceComposerclassshouldBeAppliedandgetNamefromPresetinterface and add it to a new internal interface, which our presets implements. (this method is used for guessing the preset from composer, but does not make sense with custom preset as their are not registered in our application.)Usage
Using this should be rather straight forward, creating a custom Preset should be like this
And our config file would then look like