Skip to content

Pre-release 4.2.124 → 4.2.123 — task 4.5 (config): configuration loaded like v13's LoadConfiguration, with no environment cascade - #97

Merged
agissept merged 1 commit into
masterfrom
pre-release/4.2.124
Oct 6, 2026
Merged

agissept merged 1 commit into
masterfrom
pre-release/4.2.124

Conversation

@oonid

@oonid oonid commented Oct 1, 2026 •

Copy link
Copy Markdown

Task 4.5, config — configuration loads like v13's LoadConfiguration, with no environment cascade

Stacks on #96. This is the first config slice. The fork loaded the app's configuration with the L4.2 cascade: FileLoader merged app/config/{env}/*.php over the base files. v13 has no cascade. The start script now loads configuration as v13's LoadConfiguration does, and gives the app v13's afterBootstrapping() hook. The dicoding app pair uses that hook to merge its per-environment files itself.

Changes

  • Illuminate\Foundation\Bootstrap\LoadConfiguration uses v13's name and loading rules:
    • Every *.php file under the configuration directory loads as a group.
    • Files in subdirectories load as dotted groups: config/a/b.php becomes a.b.
    • Files load in natural order of their names.
    • It sets the timezone from app.timezone, and the internal encoding to UTF-8.
    • config/{env}/ is no longer merged over the base files.
    • The config cache and the framework's default config are left out. They come with the flip.
  • The configuration directory is v13's config/ under the base path, bound as path.config. Application gains v13's configPath() and useConfigPath().
  • Application::afterBootstrapping($bootstrapper, $callback) is v13's hook. The start script fires bootstrapped: Illuminate\Foundation\Bootstrap\LoadConfiguration once the configuration has loaded, before exception handling starts and before any service provider registers.
  • Removed: Config\FileLoader, Config\LoaderInterface, Application::getConfigLoader() and ConfigFileLoaderTest.
  • Tests: the FoundationApplicationBuilderTest fixture keeps its config in config/, as a v13 app does. The path test also checks path.config, configPath() and useConfigPath(). 4 new tests check that:
    • every file loads, nested files as dotted groups, and a testing/ file is not merged;
    • useConfigPath() changes where configuration loads from;
    • the configured timezone is set;
    • an afterBootstrapping(LoadConfiguration::class, ...) callback receives the application, and runs before the providers register.

Verification

  • Fork: the suite is 276 green on PHPUnit 11.5.56: 4 new tests, and the 8 in ConfigFileLoaderTest removed. The ratchet is green, with every pattern at its baseline.
  • The tests catch real breaks. Each of these 8 mutations fails at least one test:
    • not loading subdirectories;
    • not dotting nested groups;
    • not setting the timezone;
    • useConfigPath() ignored;
    • the default path left at app/config;
    • the event not fired;
    • the event fired after the providers register;
    • the listener registered on the wrong event.
  • Downstream: the dicoding app pair is dicoding-dev/dicoding#6001 (feature/platform/framework-4.2.124-rc1). It ran with vendor installed exactly from its lock:
    • The app moves app/config/{local,testing}/ to bootstrap/environments/ and merges them with afterBootstrapping().
    • config()->all() is identical to 4.2.123 in all 4 environments the app uses: production, local, testing and endtoend. The only difference is the order of the top-level groups.
    • Psalm (full project, no cache): no errors.
    • Unit suite: 8964 green.
    • Integration suite: all 3023 tests. The only failures are the 4 long-standing ones and one order-sensitive test. That test compares two rows that tie in the query's only sort key; it passed 6 of 6 runs alone. 196 are skipped, and no test is flagged risky.
    • The real entry points (php -S + server.php → index.php, and 7 artisan commands) and the 13 in-process request scenarios are identical to 4.2.123.
  • Checks ran in a cloud container without deck (PHP 8.4.26, MariaDB 10.11).

Tag

4.2.124 (a55cf4e6) is not pushed, and neither are 4.2.119–4.2.123. Tag pushes are refused for this session.

🤖 Generated with Claude Code

https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo

@agissept
agissept force-pushed the pre-release/4.2.124 branch from a55cf4e to 4e9d6bb Compare October 2, 2026 09:20
@agissept
agissept added this pull request to stack #102 October 5, 2026 06:14
@agissept
agissept force-pushed the pre-release/4.2.124 branch 4 times, most recently from 92897d2 to d275eaf Compare October 6, 2026 02:35
Base automatically changed from pre-release/4.2.123 to master October 6, 2026 02:36
…th no environment cascade (task 4.5)

The start script loads the application's configuration with v13's
LoadConfiguration bootstrapper instead of the fork's cascading FileLoader:

- Every *.php file under the configuration directory loads as a group, and
  files in subdirectories load as dotted groups, as in v13. config/{env}/
  files are no longer merged over the base files.
- The configuration directory is v13's config/ under the base path, bound as
  path.config. Application gains v13's configPath() and useConfigPath().
- Application gains v13's afterBootstrapping(). The start script fires
  "bootstrapped: LoadConfiguration" once the configuration is loaded, before
  any service provider registers.
- The timezone is set from app.timezone by LoadConfiguration, as in v13.
- Config\FileLoader, Config\LoaderInterface and getConfigLoader() are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
@agissept
agissept force-pushed the pre-release/4.2.124 branch from d275eaf to bc8f130 Compare October 6, 2026 02:39
@agissept
agissept marked this pull request as ready for review October 6, 2026 02:39
@agissept
agissept merged commit 8b2a82c into master Oct 6, 2026
2 checks passed
@agissept
agissept deleted the pre-release/4.2.124 branch October 6, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants