-
-
Notifications
You must be signed in to change notification settings - Fork 195
Improve workflow when not using Env vars #287
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
Comments
I think it's just about a few lines of code in the EnvConfigurator, so I'd say: submit a PR, it sounds nice 👍 |
I think that not using a |
As it's not supported, I think it's a good reason to show a warning to the user telling him/her to either create the file, or be warned that env vars defined by recipes won't be usable if he/she does not set it. |
@fabpot our issues with parameters as env vars is that we just have to many. Is there a better way to do this? I am very thankful for every tip, as I really have no idea on how to improve this. What is the performance impact of DotEnv in production? It will be slower than compiled-in parameters, but is it significant? One file access and some parsing? |
I don't have a definitive answer but some hints:
|
Once env vars are set in the virtual host of your nginx / apache instance, it's not needed to repeat them. Same for the command-line: of course you will have to duplicate the same config, but you can put it in either |
Hmm, can't really confirm that: #fastcgi_param TEST "test123"; # <- does not work
location /app.php {
include php-fpm.conf;
fastcgi_param TEST "test123"; # <- does work
fastcgi_pass php7.2-testproject;
} So I either have to repeat them for every entry point or have to create a new include file for every project.
That is true, doesn't work however in shared hosting environments. We have quite a few projects on the same server (they are too small for an own VM) so I would need to manually source different files then. Also calling @fabpot thank you for your input.
How do you define the config, that doesn't need to be env vars, but differs between the servers? Do you still have a
Exposing it as 1 file is quite nice (by using the Is it possible to destructure env vars, something like (don't mind the concrete syntax please):
parameters:
app.config.db: `%env(json:file:CONFIG_FILE).db%`
app.config.secret: `%env(json:file:CONFIG_FILE).secret%` ? That could be a nice integration to combine the best of both worlds. |
You can still use one if you need. It was previously handled by incenteev/composer-parameter-handler, and you can still use it even with Flex if you need fils.
This is where you can take advantage from extensions or compiler passes: you can retrieve this array and pass it through a At compile time, you can even split it and insert it in the container afterwards with something like Hope this helps |
Closing as this improved a lot recently, with symfony/recipes#501 as the last step. |
Hi 👋
we are currently migrating to Flex and have encountered a small DX issue. I currently don't have a nice proposal, but just wanted to point out that there might be an area to improve.
If you are not using env variables, the
EnvConfiguration
command currently just bails out:flex/src/Configurator/EnvConfigurator.php
Lines 35 to 38 in 9f2d70e
In this case though, the information about which configuration parameters (in form of env variables or
env(VAR): value
in yourparameters.yaml
) the bundle expects is just lost:I am not sure about how to improve the situation except printing a message like:
So currently you have to hunt down the recipe manually in Github (potentially search the correct version), look at the
manifest.json
and proceed from there. This might be improved by just printing the already available info to the CLI in the installation process?What do you think?
The text was updated successfully, but these errors were encountered: