Repository navigation
Pre-release 4.2.127 → 4.2.126 — task 4.5 (environment): v13's environment detection, from APP_ENV by default - #100
Merged
Merged
Conversation
agissept
force-pushed
the
pre-release/4.2.127
branch
from
October 2, 2026 09:21
9415037 to
a72c1fe
Compare
agissept
added this pull request to stack #102
October 5, 2026 06:14
agissept
force-pushed
the
pre-release/4.2.127
branch
6 times, most recently
from
October 6, 2026 06:09
8a72176 to
07dd324
Compare
agissept
approved these changes
Oct 6, 2026
agissept
marked this pull request as ready for review
October 6, 2026 06:16
agissept
force-pushed
the
pre-release/4.2.127
branch
from
October 6, 2026 06:16
07dd324 to
541d7ee
Compare
…NV by default (task 4.5)
EnvironmentDetector is v13's: it takes a callback only, and on the console
both --env=X and --env X override it. Application::detectEnvironment() takes
a Closure, as in v13, and reads the console arguments only when running in
the console.
When the application sets no environment, the start script now names it
right after .env loads: APP_ENV, else production, the default v13's config
gives. The .env.{env}.php file for that environment loads next. An
environment the application detected itself still wins.
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.127
branch
from
October 6, 2026 07:18
541d7ee to
3723eae
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, environment — v13's environment detection, from
APP_ENVby defaultStacks on #99. The fork detected the environment with L4.2's rules: a map of hostnames, overridden by
--env=Xon the console. v13 takes it fromAPP_ENV, throughconfig('app.env'), defaulting to production, and only--envoverrides it. This release adopts v13's rules and API. The app can then move each machine ontoAPP_ENVbefore a later release drops its hostname list.Changes
EnvironmentDetectoris v13's:--env=Xand--env Xboth override the callback. The fork read only--env=X;--environment=Xno longer counts as--env.Application::detectEnvironment(Closure $callback)takes v13's closure. It reads the console arguments only when running in the console..envloads, when the application has set none:APP_ENV, else production, the default v13's config gives. The.env.{env}.phpfile for that environment loads next. An environment the application detected itself still wins. Before, the default was production, or--env.FoundationEnvironmentDetectorTestis rewritten for v13's rules (4 tests);FoundationApplicationTest:detectEnvironment()takes--env Xover the callback, and asks the callback when there's no--env;FoundationApplicationBuilderTest:APP_ENVfrom.envnames the environment and picks its.env.{env}.phpfile, and an environment the application detected wins overAPP_ENV.What changes
detectEnvironment()no longer takes an array. A hostname map fails with aTypeError. The dicoding app passes a closure from its pair on.--env Xnow works on the console. In the dicoding app, it left the environment empty before.Verification
APP_ENVignored;.envloads;--env Xnot read;--envtaken as--env;feature/platform/framework-4.2.127-rc1). It passes a closure todetectEnvironment():APP_ENV, else its local hostnames, else production. It ran with vendor installed from its lock, apart from the dev CLIsphpstan/phpstanandrector/rector, whose GitHub downloads are refused in this container:APP_ENV, every probe gives the same environment as 4.2.126:artisan envand aphp -Srequest, on this container's hostname and ondicoding-localanddicoding.com, each set in its own UTS namespace.APP_ENVnow names the environment on the console and the web, over the hostname.--env testinggives testing, where 4.2.126 left the environment empty.config()->all()is byte-identical to 4.2.126 in production, local, testing and endtoend.php -S+server.php→index.php, and 7 artisan commands) and the 13 in-process request scenarios are identical to 4.2.126.Tag
There's no
4.2.127tag, as there are none for4.2.119–4.2.126: tag pushes are refused for this session. The app pins thepre-release/4.2.127branch (9415037b).🤖 Generated with Claude Code
https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo