-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[5.8] Only use $_SERVER for env variables #27462
Conversation
case 'false': | ||
case '(false)': | ||
return false; | ||
case 'empty': |
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.
I am tempted to also remove handling for empty, since you can already do FOO=""
or just FOO=
, and phpdotenv will treat it as the empty string.
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.
I think that removing the "empty" will be an useless BC.
Do we need to write to $_SERVER at all? Can't we just use it for reading only and combine them with the .env values? In production it's also not written to the super globals, right? |
I know we have the ability to cache the contents of the If we no longer use |
This is no longer the case for v3. I should probably update the readme.
Yes, actually we could do that instead if we wanted (https://github.com/vlucas/phpdotenv/blob/master/src/Environment/Adapter/ArrayAdapter.php). The side effect would be that nested env variables would break though, if they were loaded outside of the env file. We'd also need to find a good way to share this adapter instance.
That was actually never used, and is kinda badly named. The sever superglobal behaves as you might expect env to.
Yes, always, and not always in the env supergloal.
Yeh, so no changes there. :) |
Rock on 🤘🏻 |
Laravel 5.8 limits dotenv to only rely on $_SERVER and not $_ENV. See laravel/framework#27462
@GrahamCampbell can you send in the same PR to |
Yes, of course. :) |
Is a 5.8 branch getting split off there soon also? |
@driesvints here we are: laravel/lumen-framework#877 and laravel/lumen#128. |
We're going to do this after the framework release. |
@GrahamCampbell or @driesvints is this a breaking change for when you upgrade from 5.7 to 5.8? If so we maybe also need to update the "Upgrade Guide" for the docs to tell people to change the |
phpunit config does not need changing actually. |
See #27519. |
We had to update our |
Laravel 5.8 limits dotenv to only rely on $_SERVER and not $_ENV. See laravel/framework#27462
* Target Laravel 5.8 * Update composer.json * Update `RegisterController` password validation rule and associated lang file * Update UserFactory password in line with #4794 The new password is of 8 characters, as required by #4794 * Update VerificationController.php * add dynamo to stubs * tweak wording * Modify RedirectIfAuthenticated middleware to accept multiple guards * add env variable for mysql ssl cert * Add beanstalk queue block_for config key This functionality was added in laravel/framework 9aa1706. * Hint for lenient log stacks * adjust name of configuration value * Use same version as framework * Use $_SERVER instead of $_ENV for phpunit. Laravel 5.8 limits dotenv to only rely on $_SERVER and not $_ENV. See laravel/framework#27462 * change default redis configuration structure * update client * update config file * [5.8] use bigIncrements by default All new migrations will be using bigIncrements laravel/framework#26472 * Revert "[5.8] Modify RedirectIfAuthenticated middleware to accept multiple guards" * revert to old redis config * add postmark token * Add Arr and Str aliases by default * add postmark * update env variable stubs * set default region * add bucket to env example * Use correct env name for AWS region from env.example * comment * comment out options * check if extension loaded * Ignore SQLite journals * Prefix redis database connection by default to mitigate multiple sites on the same server potentially sharing the same queued jobs * Use Str class instead of helper function * Additional underscore on redis database prefix * Additional underscore on cache prefix * Remove underscore as cache prefixes automatically have a colon appended to them * Update UserFactory.php * Fix phpdoc to order by syntax convention (#5005) Reorder the `@var` phpdoc syntax by convention, see http://docs.phpdoc.org/references/phpdoc/tags/var.html * Update database config relating to Url addition. * formatting * Add ends_with validation message * Fix type hint for case of trusting all proxies (string) (#5025) * Add DYNAMODB_ENDPOINT to the cache config (#5034) This adds the DYNAMODB_ENDPOINT environment variable to the dynamodb store of the cache cofig. Its usage is implemented in the framework as laravel/framework#28600 * Added support for new redis URL property in config/database.php (#5037) Regarding laravel/framework#28612 * use generic default db config * Update .gitignore (#5046) * Move TrustProxies to highest priority - fixes maintenance mode ip whitelist if behind proxy e.g. Cloudflare (#5055) * update deprecated pusher option (#5058) * Using environment variable to set redis prefix (#5062) It was the only redis setting that wasn't overridable by an environment variable. It can help if you have multiple instances using the same `APP_NAME`, e.g. a staging instance * Remove Stripe config settings These now ship with a dedicated config file for Cashier. * formatting * Update composer.lock * Revert "[5.8] use bigIncrements by default" This reverts commit 6c5798e. * Update laravel/telescope
Laravel 5.8 limits dotenv to only rely on $_SERVER and not $_ENV. See laravel/framework#27462
Sorry for posting 6 years too late, but I made a package that provides https://github.com/PHPExpertsInc/Laravel57-env-polyfill
|
This change:
env
function to only look at $_SERVERenv
function stripping quotes.Why?