Skip to content

Commit 0d8064f

Browse files
authored
Merge pull request #7944 from kenjis/docs-configuration.rst
docs: improve configuration.rst
2 parents 2ad658d + b63b625 commit 0d8064f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

user_guide_src/source/database/configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
**************************
109111
Configuring with .env File
110112
**************************

user_guide_src/source/general/configuration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
186190
If the prefix of a namespaced variable exactly matches the namespace of the configuration
187191
class, then the trailing part of the setting (after the dot) is treated as a configuration
188192
property. 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
233237
When you have the property ``$default = ['encrypt' => false]`` in your
234238
``Config\Database``, you cannot change the ``encrypt`` value to an array even if
235239
you 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

237243
Treating Environment Variables as Arrays
238244
========================================

0 commit comments

Comments
 (0)