-
-
Notifications
You must be signed in to change notification settings - Fork 495
Allow to override .env files per env #481
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
Conversation
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
I improved the phpunit-bridge integration: it now uses |
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
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.
Pull request passes validation.
umask(0000); | ||
|
||
if (class_exists(Debug::class)) { | ||
Debug::enable(); | ||
} | ||
} | ||
|
||
$kernel = new Kernel($env, $debug); | ||
$kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']); |
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.
You need to cast $_SERVER['APP_DEBUG'] to boolean to not rely on implicit typecast.
…icolas-grekas) This PR was merged into the 1.1-dev branch. Discussion ---------- Skip updating phpunit.xml files when .env.test exists This is to support `.env` < `.env.local` < `.env.test` < `.env.test.local` dotenv files *withouth affecting existing workflows* based on `.env(.dist)` and `phpunit.xml(.dist)`. Leveraged by symfony/recipes#481 Best reviewed [ignoring whitespaces](https://github.com/symfony/flex/pull/434/files?w=1). Commits ------- ae7128a Skip updating phpunit.xml files when .env.test exists
It looks like the "env Configurator" is broken since this PR? I try to set up a new API Platform project via:
At this point, after installing all the packages etc., the console reads If I manually create a Another use case:
This also generates an empty .env file. |
/cc @nicolas-grekas |
(fixed by bumping flex to v1.1.7 in skeletons) |
To make others aware, there is a breaking change here if your coding standard adds
So, exclude these file from your cs fixer config. |
@bendavies or add an explicit |
@ciaranmcnulty well yes, but I'd rather keep inline with upstream so I can just copy and paste updates from recipes in future without having to diff my own changes. I'm treating these files as vendors essentially. This was a good bug, as our integration tests don't hit |
This PR is an alternative to #466 and replaces #479.
It needs symfony/symfony#29129 to work with 4.2.
What we have here:
.env
<.env.local
<.env.$env
<.env.$env.local
(only the 1st is required, see PR linked above)Kernel::bootstrapEnv()
method--env
&--no-debug
(seeKernel::bootstrapCliEnv()
, fixes [Console] Option -e prod is interpreted as a command when no command is specified symfony#23343).env
files are loaded for tests (fixes Quote inconsistency between env vars in phpunit.xml.dist and .env flex#317, PhpUnit Bridge env variables set in phpunit.xml not available in parallel testsuites symfony#28895 and SYMFONY_DEPRECATIONS_HELPER has no affect when defined in phpunit.xml.dist. symfony#28726)phpunit.xml.dist
to.env.test
.env.dist
is not created anymore (commit.env
instead and use.env.local
for local overrides).gitignore
is updated accordinglyRegarding flex integration:
.env.test
file, it should skip updatingphpunit.xml
files.env.dist
just need to create the file and flex will populate it as it does today)