-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Change .env UF_MODE not working #1177
Comments
Possible fix (getenv() was deprecated and changed to $_ENV[] ): Change: $mode = getenv('UF_MODE') ?: "" |
Which version of UserFrosting are you using? There was an issue with using
|
I'm using the latest version 4.6. If i change that line to $mode = array_key_exists("UF_MODE", $_ENV) ? $_ENV['UF_MODE'] : "default"; it works properly. That's what is in the phptdotenv documentation: "Putenv and Getenv $s3_bucket = getenv('S3_BUCKET'); $dotenv = Dotenv\Dotenv::createImmutable(DIR); The above example will write loaded values to $_ENV and putenv, but when interpolating environment variables, we'll only read from $_ENV. Moreover, it will never replace any variables already set before loading the file. By means of another example, one can also specify a set of variables to be allow listed. That is, only the variables in the allow list will be loaded: $repository = Dotenv\Repository\RepositoryBuilder::createWithDefaultAdapters() $dotenv = Dotenv\Dotenv::create($repository, DIR); |
This has been fixed in eed5f9b and v4.6.2 |
When i change UF_MODE to production, erros are still displayed and assets-raw used.
however looking for some troubleshooting, i found that:
changing $mode = getenv('UF_MODE') ?: "" to $mode = env('UF_MODE', '') on CORE Sprinkle ServiceProvider, line 244, resolves the problem.
is that save to use in production? uncomment and use env() instead of getenv() ?
The text was updated successfully, but these errors were encountered: