Imports a configuration based on the "CFConfig" format.
This configuration can be provided as a path (String) to a JSON based file or as a Struct.
The values inside the provided configuration can use placeholders following this pattern ${key:default}.
The function will check for the actual values for this placeholders in 3 places (in this order):
- function argument "params" (if provided)
- system properties
- environment variables
Lucee Function Reference
configimport()
Introduced: 5.3.8.207
Example
configimport(any path,[string type,[string password,[struct params,[string charset]]]]):struct
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
path | any | Yes | Path to the .CFConfig.json file or the data itself as a Struct. | |
type | string | No | server | Config Context to manipulate, server or web context. |
password | string | No |
password to access the configuration, depending on the value set for the attribute type. If not set Lucee will check in the following places for the password (replace {type} with the actual type chosen for the attribute type). Environment variable "LUCEE_{type}_ADMIN_PASSWORD" or system property "lucee.{type}.admin.password". |
|
params | struct | No | placeholder parameters to use as actual data for the placeholders inside the configuration, see main description of this function for more details. | |
charset | string | No | charset to use to read the .CFConfig file, if not defined, Lucee will use the default resource charset. |