Repository navigation
Pre-release 4.2.126 → 4.2.125 — task 4.5 (config): .env files load with v13's LoadEnvironmentVariables - #99
Merged
Merged
Conversation
agissept
force-pushed
the
pre-release/4.2.126
branch
from
October 2, 2026 09:20
84d2f6a to
a04aefa
Compare
agissept
added this pull request to stack #102
October 5, 2026 06:14
agissept
force-pushed
the
pre-release/4.2.126
branch
6 times, most recently
from
October 6, 2026 06:09
4b64173 to
4dfedc8
Compare
agissept
marked this pull request as ready for review
October 6, 2026 06:15
… (task 4.5)
The start script loads the application's .env file with v13's
LoadEnvironmentVariables bootstrapper and vlucas/phpdotenv, before the L4.2
.env.{env}.php file:
- .env is read from the base path, or .env.{env} when --env or APP_ENV names
an environment that has its own file, as in v13. Variables already in the
process environment are kept.
- The .env.{env}.php file still loads afterwards and wins on the keys both
files define, so applications without a .env file see no change.
- Application gains v13's environmentPath(), useEnvironmentPath(),
loadEnvironmentFrom(), environmentFile() and environmentFilePath().
- vlucas/phpdotenv becomes a requirement. It also makes illuminate/support's
env() helper usable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
agissept
force-pushed
the
pre-release/4.2.126
branch
from
October 6, 2026 06:16
4dfedc8 to
33008e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task 4.5, config —
.envfiles load with v13'sLoadEnvironmentVariablesStacks on #98. This is the third config slice. v13 reads the environment from a dotenv
.envfile. The fork read only the L4.2.env.{env}.phparrays. The start script now loads.envfirst with v13'sLoadEnvironmentVariablesandvlucas/phpdotenv, then the.env.{env}.phpfile as before. That file still wins on the keys both define, so an application with no.envfile sees no change. Environment files can then move to.envone deployment at a time, before theAPP_ENVslice drops the hostname map.Changes
Illuminate\Foundation\Bootstrap\LoadEnvironmentVariablesuses v13's name and file selection:.envfromenvironmentPath(), the base path by default..env.{env}instead when the console's--envoption or theAPP_ENVvariable names an environment that has its own file.Envrepository is immutable.The start script runs it just before the
.env.{env}.phpfile loads, so the PHP file's values win on shared keys.Applicationgains v13'senvironmentPath(),useEnvironmentPath(),loadEnvironmentFrom(),environmentFile()andenvironmentFilePath().vlucas/phpdotenv^5.6.1 becomes a requirement. It is what v13'sEnvclass and theenv()helper inilluminate/supportneed, soenv()now works too.Tests: a new
FoundationLoadEnvironmentVariablesTest(7 tests) checks that:.envloads intogetenv(),$_ENV,$_SERVERandenv();--envandAPP_ENVeach pick.env.{env};.env;.envloads nothing;useEnvironmentPath()moves where.envis read from.FoundationApplicationBuilderTestchecks that the start script loads.envand that.env.testing.phpwins on a shared key.What changes
.envstops the app. phpdotenv rejects lines such asKEY=a b, and the start script lets itsInvalidFileExceptionthrough. In the dicoding app, artisan exits 255 with the message and a stack trace, and HTTP requests get a 500 with an empty body and the message in the server log. v13 prints "The environment file is invalid!" and exits 1. phpdotenv doesn't reject an unterminated quote such asKEY="abc; that line loads nothing.Verification
.env;--envignored;APP_ENVignored;.env.{env}not checked;useEnvironmentPath()ignored;feature/platform/framework-4.2.126-rc1). It pins this release, and its lock gainsvlucas/phpdotenvand its two dependencies. It ran with vendor installed from its lock, apart from the dev CLIsphpstan/phpstanandrector/rector, whose GitHub downloads are refused in this container:config()->all()is byte-identical to 4.2.125 in production, local, testing and endtoend..envloading, probed by booting the app's console kernel: a valid.envreachesenv()andgetenv(), and none leaves them empty.php -S+server.php→index.php, and 7 artisan commands) and the 13 in-process request scenarios are identical to 4.2.125.Tag
There's no
4.2.126tag, as there are none for4.2.119–4.2.125: tag pushes are refused for this session. The app pins thepre-release/4.2.126branch (84d2f6ac).🤖 Generated with Claude Code
https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo