Skip to content

Commit dcf39fd

Browse files
authoredJul 20, 2023
Update system-settings-java-properties-and-environment-variables.md
This page used the deprecated pre-v7 way to access system settings/properties/env from outside Coldbox core files. I *assume* that within `Coldbox.cfc` and friends, using the 3 functions will be automatically resolved to the `Env` delegate, @lmajano ?
1 parent e71be7d commit dcf39fd

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
 

‎getting-started/configuration/coldbox.cfc/system-settings-java-properties-and-environment-variables.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@ If you are inside `config/ColdBox.cfc` or a `ModuleConfig.cfc` or a `config/Wire
1414

1515
## Accessing System Settings in `Application.cfc`
1616

17-
If you would like to access these methods in your `Application.cfc`, create an instance of `coldbox.system.core.util.Util` and access them off of that component. This is required when adding a datasource from environment variables.
17+
If you would like to access these methods in your `Application.cfc`, create an instance of `coldbox.system.core.delegates.Env` and access them off of that component. This is required when adding a datasource from environment variables.
1818

1919
Example:
2020

2121
{% code title="Application.cfc" %}
2222
```javascript
23-
component {
2423

25-
variables.util = new coldbox.system.core.util.Util();
24+
component {
25+
26+
variables.env = new coldbox.system.core.delegates.Env();
2627

2728
this.datasources[ "my_datasource" ] = {
28-
driver = util.getSystemSetting( "DB_DRIVER" ),
29-
host = util.getSystemSetting( "DB_HOST" ),
30-
port = util.getSystemSetting( "DB_PORT" ),
31-
database = util.getSystemSetting( "DB_DATABASE" ),
32-
username = util.getSystemSetting( "DB_USERNAME" ),
33-
password = util.getSystemSetting( "DB_PASSWORD" )
29+
driver = env.getSystemSetting( "DB_DRIVER" ),
30+
host = env.getSystemSetting( "DB_HOST" ),
31+
port = env.getSystemSetting( "DB_PORT" ),
32+
database = env.getSystemSetting( "DB_DATABASE" ),
33+
username = env.getSystemSetting( "DB_USERNAME" ),
34+
password = env.getSystemSetting( "DB_PASSWORD" )
3435
};
3536

3637
}

0 commit comments

Comments
 (0)
Please sign in to comment.