-
Notifications
You must be signed in to change notification settings - Fork 1
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
Parameter config directive #4
Comments
That'd be nice to be able to configure easily an Objective application with environment variables. I suggest to rename I have a question though, how in your application do you retrieve this kind of config ? Currently we get them like that: So for the environments it'll be It will be confusing for the developers. Should i get "Param" or ParameterDirective ? |
I think it would be better to get things working like : $config->subset(ApplicationConfiguration::class)->get('APP_MODE'); ( |
I think parameters must be mandatory by default. If no default value are provided, it could be possible to make the directive optional :
This is mean if Right ? |
@fanshan I agree that it's better to make it mandatory by default with the If If
|
I added the ability to load variables from dotenv files. |
ObjectivePHP RFC: Parameter config directive
Summary
An app’s config is everything that is likely to vary between deploys (staging, production, developer environments, etc). I suggest, according to 12 factors app, a strict separation of config from code. Config varies substantially across deploys, code does not.
Currently we are able to override the config with a
.local.php
file. That's a way we can keep.I suggest to add a feature to the config component, to reach the environment variables.
Proposal
Using a Environment Directive with default value :
Using an optional Environment Directive :
We also need to add another loader
ObjectivePHP\Config\Loader\DotenvLoader
. It will usevlucas/phpdotenv
.Backward Incompatible Changes
It will not include Incompatible Changes, it's a MINOR enhancement
Proposed ObjectivePHP Version(s)
objective-php/config 1.1.0
RFC Impact
To Components
NO
To Packages
NO
To Workflow
NO
To Configuration
It add this new way to manage changes between environments.
Future Scope
Future scope can be the extension of this directive with
SecretParameterDirective
that store encrypted value of the parameter.Proposed Voting Choices
50%+1 majority
Links to external references, discussions, issues or RFCs
The text was updated successfully, but these errors were encountered: