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
Unable to nest variables #98
Comments
This has been fixed. We changed Turns out |
phpdotenv follows the correct bash/shell syntax, which is $> export DRONE_BUILD_NUMBER=42
$> export DB_DATABASE="BUILD_${DRONE_BUILD_NUMBER}"
$> echo $DB_DATABASE ]
$> BUILD_42 You can also test it with: source .env && echo $DB_DATABASE |
👍 |
phpdotenv does not properly inline env variables in laravel 5.1
Switching to I don't know if this behavior has been changed since laravel 5.1, but it would definitely be good to mention it somewhere visible. Or, since the |
Laravel 5.1 uses an old version of this package. |
But since Laravel's docs do not specify inline semantics, and people will look to this documentation for guidance, we're left with a very confusing error. I can try and open a PR to fix the Laravel docs, but probably not the only one who would look to your docs first. Do you think mentioning the old syntax in the main README would be useful? Something along the lines of: "For old versions of dotenv, use {$VAR} instead of ${VAR}" |
I'd say that I'd expect people to look at the readme for the correct version? |
Unfortunately, it's not that easy to know what the correct version is when it's vendored like this. Also, 5.1 is the LTS release of Laravel, so it's expected to stick around for a good while still (2 years active dev, 3 years security fixes, starting July 19, 2016). The docs (https://laravel.com/docs/5.1#environment-configuration) also simply link to the latest version of DotEnv (instead of to ~1.0) adding to the confusion. |
We are trying to set up our CI for a laravel project, we use drone as our CI tool. We are running into an issue with the .env file where when we try to add the build number for the database we are using, it does not interpolate the string with the build number.
APP_ENV=test APP_DEBUG=true APP_KEY=SomeRandomString DB_HOST=server DB_DATABASE="BUILD_${DRONE_BUILD_NUMBER}" DB_USERNAME=user DB_PASSWORD=password CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null
The issue is here:
DB_DATABASE="BUILD_${DRONE_BUILD_NUMBER}"
. We are running our laravel 5 app inside docker on a drone environment, anybody run into this before?The text was updated successfully, but these errors were encountered: