Skip to content
Corex

SiteEnvironment

Corex\Environment\SiteEnvironment · class · Core layer

The one answer to “is this a development, staging or production site” (spec 113, FR-001). In this order: APP_ENV in .env, a value the network locks, or the corex_app_env option, each of which locks the operations mode; then the operations mode the owner chose; then WordPress’s environment type. Coming soon and Maintenance are production here: they change what visitors see, not where mail goes. The three lock layers are read one by one rather than through the config repository, whose defaults layer answers app.env with “production” on every site and so hides the two answers below it.

Whether an operations mode may be chosen while a lock decides: the lock’s own environment, and Coming soon and Maintenance under any lock. Without a lock every mode may.

What a value of APP_ENV or of WordPress’s environment type means here.

What an operations mode means here; null for a value that is not a mode.