Skip to content

Commit 522e908

Browse files
Merge branch '6.1' into 6
2 parents d7b556d + 5c2f3bf commit 522e908

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

en/00_Getting_Started/03_Environment_Management.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Environment::setEnv('API_KEY', 'AABBCCDDEEFF012345');
6767
```
6868

6969
> [!WARNING]
70+
> Environment variables set using `Environment::setEnv()` in `_config.php` files are not available to YAML configuration (including conditions like `envvarset` in `Only`/`Except`). This is because YAML config is loaded during the manifest boot phase, which occurs before `_config.php` files are executed. To use environment variables in YAML config, define them in your `.env` file or as actual system environment variables.
71+
>
7072
> `Environment::getEnv()` will return `false` whether the variable was explicitly set as `false` or simply wasn't set at all. You can use [`Environment::hasEnv()`](api:SilverStripe\Core\Environment::hasEnv()) to check whether an environment variable was set or not.
7173
7274
### Using environment variables in config

0 commit comments

Comments
 (0)