@@ -162,6 +162,21 @@ is functionally equivalent for the user — foreground server, Ctrl-C
162162shuts it down — but the process tree shows envlite as the parent of
163163` php -S ` .
164164
165+ ** Worker pool.** Before the launch (Unix or Windows), envlite calls
166+ ` putenv('PHP_CLI_SERVER_WORKERS=3') ` so the built-in server forks
167+ three worker processes and one slow request does not block every
168+ other one behind it. ` PHP_CLI_SERVER_WORKERS ` is the only knob —
169+ PHP exposes no CLI flag — and the variable was introduced in PHP
170+ 7.4.0, matching envlite's preflight floor (no version gating
171+ needed). On Windows the variable is documented as unsupported and
172+ silently ignored, so setting it there is harmless. If the user has
173+ already exported ` PHP_CLI_SERVER_WORKERS ` in their environment,
174+ envlite leaves it alone (` getenv() ` check before ` putenv() ` ). The
175+ SQLite drop-in serializes writes through SQLite's file lock, so
176+ concurrent workers cannot corrupt ` .ht.sqlite ` ; the worst case is a
177+ short serialization wait under contention, which is the same
178+ behavior a single worker would have produced sequentially.
179+
165180The router is committed at ` tools/local-env/router.php ` alongside
166181` envlite.php ` ; it is not installed into the repo, the manifest does
167182not track it, and ` clean ` does not remove it. It has no inputs (the
@@ -1053,7 +1068,22 @@ explicit user assent. Users who want a fully clean slate run
10531068 login. ` localhost ` would also depend on ` /etc/hosts ` and the
10541069 system resolver; ` 127.0.0.1 ` is a literal address with no
10551070 surprises.
1056- 14 . ** Test DB is isolated via ` DB_FILE ` in the test config only.**
1071+ 14 . ** ` PHP_CLI_SERVER_WORKERS=3 ` on ` php -S ` launch.** PHP's built-in
1072+ server is single-threaded by default — one slow request (a WP
1073+ admin page, a long REST call) blocks everything behind it,
1074+ including the parallel admin-ajax calls (heartbeat, autosave) a
1075+ single page can fire. The env var is the only knob; there is no
1076+ CLI flag. Available since PHP 7.4 (matches envlite's floor, so
1077+ Phase 0 already guards this) and silently ignored on Windows where
1078+ it is documented as unsupported — setting it there is harmless,
1079+ so envlite's launch path is platform-uniform (` putenv() ` before
1080+ ` pcntl_exec ` /` proc_open ` ). Three workers covers typical WP-admin
1081+ concurrency (the page request plus one or two parallel admin-ajax
1082+ calls) without meaningful memory overhead, and SQLite's file lock
1083+ serializes writes so the multi-worker model can't corrupt the DB.
1084+ A user-exported ` PHP_CLI_SERVER_WORKERS ` is respected (envlite
1085+ only ` putenv() ` s when the variable is unset).
1086+ 15 . ** Test DB is isolated via ` DB_FILE ` in the test config only.**
10571087 phpunit's ` tests/phpunit/includes/install.php ` drops every WP
10581088 table on every run; without isolation it would wipe the dev
10591089 site Phase 8 installs. The split is one `define( 'DB_FILE',
0 commit comments