Skip to content

Commit

Permalink
Merge pull request #7944 from kenjis/docs-configuration.rst
Browse files Browse the repository at this point in the history
docs: improve configuration.rst
  • Loading branch information
kenjis authored Sep 20, 2023
2 parents 2ad658d + b63b625 commit 0d8064f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions user_guide_src/source/database/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ within the class' constructor:

.. literalinclude:: configuration/008.php

.. _database-config-with-env-file:

**************************
Configuring with .env File
**************************
Expand Down
6 changes: 6 additions & 0 deletions user_guide_src/source/general/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ are considered for merging into the configuration object's properties.
.. important:: You cannot add a new property by setting environment variables,
nor change a scalar value to an array. See :ref:`env-var-replacements-for-data`.

.. note:: This feature is implemented in the ``CodeIgniter\Config\BaseConfig``
class. So it will not work with a few files in the **app/Config** folder
that do not extends the class.

If the prefix of a namespaced variable exactly matches the namespace of the configuration
class, then the trailing part of the setting (after the dot) is treated as a configuration
property. If it matches an existing configuration property, the environment variable's
Expand Down Expand Up @@ -233,6 +237,8 @@ expect your ``Config\App`` to magically have that property and value at run time
When you have the property ``$default = ['encrypt' => false]`` in your
``Config\Database``, you cannot change the ``encrypt`` value to an array even if
you put ``database.default.encrypt.ssl_verify = true`` in your **.env**.
If you want to do like that, see
:ref:`Database Configuration <database-config-with-env-file>`.

Treating Environment Variables as Arrays
========================================
Expand Down

0 comments on commit 0d8064f

Please sign in to comment.