Skip to content

Inline the config cache LoadConfiguration override - #496

Closed
oxyc wants to merge 1 commit into
masterfrom
fix/inline-config-cache-override
Closed

oxyc wants to merge 1 commit into
masterfrom
fix/inline-config-cache-override

Conversation

@oxyc

@oxyc oxyc commented Nov 16, 2026

Copy link
Copy Markdown
Member

acorn optimize (deployer-genero's cache:wp:acorn) bakes one config array from a single WP-CLI boot, and every site on the install reads it. On a multisite that freezes per-site config (a child theme's own config/, anything derived from WP_HOME or the blog id) on whichever site built the cache. Single sites aren't exposed today, but every repo now carries the same block so a site that grows a second blog is already covered.

The boot file binds an anonymous subclass of Acorn's LoadConfiguration that, after a cached boot:

  • re-reads the config files, and
  • keeps the cached app.providers, since a cached boot only gets the withProviders() providers from the cache (re-reading app.php alone drops them, as happened in https://github.com/generoi/pellervo/pull/265).

Where the repo had App\Bootstrap\LoadConfiguration, this replaces it with the inline block, and class-only tests are swapped for test/unit/AcornConfigCacheTest.php. That test bakes a real cache with one stale value and an extra provider, then boots from it.

Same change as https://github.com/generoi/pellervo/pull/266, https://github.com/generoi/holmasto/pull/223 and https://github.com/generoi/steripolar/pull/308, all verified on production. The block was audited against Acorn 3.3, 4.3, 5.0 and 6.3.

🤖 Generated with Claude Code

`acorn optimize` bakes one config array from a single WP-CLI boot and every
site on the install reads it, so per-site config (child theme config, WP_HOME,
the blog id) freezes on whichever site built it. Bind an anonymous subclass of
Acorn's LoadConfiguration in the boot file that re-reads the config files after
a cached boot and keeps the cached provider list, which is where a cached boot
gets the withProviders() providers from.

Replaces App\Bootstrap\LoadConfiguration where a site had it, so every repo
carries the same block. AcornConfigCacheTest bakes a real cache and checks both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oxyc

oxyc commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Closing: a single site reads its own config cache, so it isn't exposed. The override is going to multisites only.

@oxyc oxyc closed this Nov 16, 2026
@oxyc
oxyc deleted the fix/inline-config-cache-override branch November 16, 2026 19:27
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.

1 participant