File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ within the class' constructor:
105105
106106.. literalinclude :: configuration/008.php
107107
108+ .. _database-config-with-env-file :
109+
108110**************************
109111Configuring with .env File
110112**************************
Original file line number Diff line number Diff line change @@ -183,6 +183,10 @@ are considered for merging into the configuration object's properties.
183183.. important :: You cannot add a new property by setting environment variables,
184184 nor change a scalar value to an array. See :ref: `env-var-replacements-for-data `.
185185
186+ .. note :: This feature is implemented in the ``CodeIgniter\Config\BaseConfig``
187+ class. So it will not work with a few files in the **app/Config ** folder
188+ that do not extends the class.
189+
186190If the prefix of a namespaced variable exactly matches the namespace of the configuration
187191class, then the trailing part of the setting (after the dot) is treated as a configuration
188192property. If it matches an existing configuration property, the environment variable's
@@ -233,6 +237,8 @@ expect your ``Config\App`` to magically have that property and value at run time
233237When you have the property ``$default = ['encrypt' => false] `` in your
234238``Config\Database ``, you cannot change the ``encrypt `` value to an array even if
235239you put ``database.default.encrypt.ssl_verify = true `` in your **.env **.
240+ If you want to do like that, see
241+ :ref: `Database Configuration <database-config-with-env-file >`.
236242
237243Treating Environment Variables as Arrays
238244========================================
You can’t perform that action at this time.
0 commit comments