Skip to content

fix(wordpress): map app.env to WP_ENVIRONMENT_TYPE - #444

Open
Boulea7 wants to merge 1 commit into
Pollora:developfrom
Boulea7:hotfix/443-wordpress-environment
Open

Boulea7 wants to merge 1 commit into
Pollora:developfrom
Boulea7:hotfix/443-wordpress-environment

Conversation

@Boulea7

@Boulea7 Boulea7 commented Oct 8, 2026

Copy link
Copy Markdown

Map Laravel's app.env to a default WP_ENVIRONMENT_TYPE before WordPress loads, so app.env=local produces local. The mapping also handles dev, development, testing, and staging, while preserving explicit process environment values, configured constants, and constants that are already defined.

Fixes #443.

The documentation submodule points to the companion documentation PR. Its commit is based on current docs main, so it also advances the older documentation snapshot.

Passed individually on PHP 8.4 with memory_limit=1G:

  • composer test:refacto -- --debug
  • composer test:lint
  • composer test:types
  • composer test:unit: 1990 tests, 4012 assertions, including 28 new environment regression cases.
  • composer test:type-coverage: 99.2%.

The regression cases exercise the real bootstrap and constant manager with the repository's WordPress stubs. DDEV and WordPress core integration were not run.

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