Skip to content

Commit 348bcca

Browse files
lonnieezellclaude
andcommitted
docs(#10615): clarify putenv() cache limits in Worker Mode
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e688569 commit 348bcca

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎user_guide_src/source/changelogs/v4.8.0.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Behavior Changes
6363
- **Commands:** The ``phpini:check`` command's invalid-argument error now prints only ``You must specify a correct argument.``. The usage example and the argument listing moved to ``phpini:check --help``, where the argument is now named ``section``. Scripts that grep the previous output will need updating.
6464
- **Config:** ``CodeIgniter\Config\BaseService`` is now ``abstract``. It is intended to be extended (as ``Config\Services`` does) and accessed statically; code that instantiated it directly with ``new BaseService()`` will now throw an ``Error``.
6565
- **Config:** ``BaseConfig`` now scans the environment once instead of checking every property against it, which makes building config classes
66-
several times faster without config caching and in Worker Mode. As a result, a bare ``putenv()`` call made after the first config class was built
67-
may not be seen until ``BaseConfig::reset()`` runs. See :ref:`upgrade-480-config-env-lookups`.
66+
several times faster without config caching and in Worker Mode. As a result, a bare ``putenv()`` call (adding, changing, or removing a variable) made
67+
after the first config class was built may not be seen until ``BaseConfig::reset()`` runs, including in later requests in Worker Mode. See :ref:`upgrade-480-config-env-lookups`.
6868
- **Database:** The Postgre driver's ``$db->error()['code']`` previously always returned ``''``. It now returns the 5-character SQLSTATE string for query and transaction failures (e.g., ``'42P01'``), or ``'08006'`` for connection-level failures. Code that relied on ``$db->error()['code'] === ''`` will need updating.
6969
- **Debug:** ``CodeIgniter\Debug\Toolbar\Collectors\BaseCollector`` is now ``abstract``. Custom toolbar collectors must extend it; code that instantiated it directly with ``new BaseCollector()`` will now throw an ``Error``.
7070
- **Filters:** HTTP method matching for method-based filters is now case-sensitive. The keys in ``Config\Filters::$methods`` must exactly match the request method

‎user_guide_src/source/installation/upgrade_480.rst‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ looking up every property of every config class. The matching rules and their
170170
order are unchanged. One edge case behaves differently: a ``putenv()`` call
171171
that does not also write ``$_ENV`` or ``$_SERVER``, made after the first config
172172
class was built, may not be seen by config classes built later until
173-
``BaseConfig::reset()`` runs. Values loaded from the **.env** file are not
173+
``BaseConfig::reset()`` runs. This applies whether the variable is added,
174+
changed, or removed. In Worker Mode, this cache persists across requests, so
175+
such changes may not be seen in later requests either. To make the change
176+
visible, also set the value in ``$_ENV`` (or unset it there), or call
177+
``BaseConfig::reset()``. Values loaded from the **.env** file are not
174178
affected, since they are written to ``$_ENV`` and ``$_SERVER`` as well.
175179

176180
Config classes that override ``getEnvValue()`` or ``initEnvValue()`` keep the

0 commit comments

Comments
 (0)