Skip to content

Commit c0ec87c

Browse files
committed
Iterate on README
1 parent dea770d commit c0ec87c

1 file changed

Lines changed: 31 additions & 21 deletions

File tree

tools/local-env/README.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# envlite
22

33
A zero-daemon local environment for `wordpress-develop`. Runs WordPress
4-
on SQLite via PHP's built-in server. No MySQL, no Docker, no MAMP.
5-
Unrelated to the `npm run env:*` Docker stack that shares this
6-
directory.
4+
on SQLite via PHP's built-in server, and gets
5+
`./vendor/bin/phpunit --group html-api` running green. No MySQL, no
6+
Docker, no MAMP.
77

88
## Quickstart
99

@@ -14,23 +14,27 @@ php tools/local-env/envlite.php up
1414
```
1515

1616
That sets up the environment and starts the dev server in the
17-
foreground. Open the URL it prints; log in at `/wp-login.php` with
18-
`admin` / `password`. Ctrl-C shuts it down.
17+
foreground at `http://127.0.0.1:<port>`, where `<port>` is auto-picked
18+
from 8100–8899 on first run and cached at `.envlite/port` for reuse.
19+
Open the URL it prints; log in at `/wp-login.php` with `admin` /
20+
`password`. Ctrl-C shuts it down.
1921

20-
The first run needs network access. Subsequent runs are offline. Re-run
21-
`up` any time — envlite **never drops tables**, so your local content
22-
survives.
22+
The first run needs network access (npm + Composer deps, plus a
23+
pinned SQLite drop-in plugin). Subsequent runs are offline.
24+
25+
Re-runs are safe. envlite skips work that's already done, prompts
26+
before touching anything you've changed, and **never drops tables**
27+
your local content survives.
2328

2429
## Requirements
2530

2631
- PHP ≥ 7.4 with `pdo_sqlite`, `sqlite3`, `openssl`, `simplexml`, `zip`.
27-
Unix also requires `pcntl`.
32+
On Unix only, also `pcntl`.
2833
- Node ≥ 20.10, npm ≥ 10.2.3.
2934
- Composer ≥ 2.
3035

31-
Ubuntu/Debian extensions are usually split out:
32-
`apt install php-sqlite3 php-xml php-zip`. Homebrew's `php` bundles
33-
them.
36+
envlite checks these at startup and aborts with a clear error if
37+
anything is missing.
3438

3539
## Other commands
3640

@@ -40,12 +44,19 @@ php tools/local-env/envlite.php serve # server only (after init)
4044
php tools/local-env/envlite.php clean # remove envlite-created files
4145
```
4246

43-
`init` and `up` accept `--port=N` (1–65535) and `--no-build` (skip
44-
`npm run build:dev`). The chosen port is cached and reused. Pass
45-
`--force` to skip prompts in non-interactive contexts.
47+
`init` and `up` accept:
48+
- `--port=N` — pick a specific port (1–65535) and cache it.
49+
- `--no-build` — skip `npm run build:dev`. Don't use this on a fresh
50+
checkout; phpunit will fail with `ABSPATH constant ... non-existent path`.
51+
- `--force` — skip prompts (envlite prompts before overwriting files
52+
you've modified). Required for non-interactive contexts.
4653

47-
`./vendor/bin/phpunit --group html-api` runs the green-bar test contract
48-
(~5 s, ~1365 tests). Other groups may surface deprecations on newer PHP.
54+
`clean` removes envlite's config files (`src/wp-config.php`,
55+
`wp-tests-config.php`, `src/wp-content/db.php`), the bundled SQLite
56+
plugin directory, the cached port, and — on a single confirmation
57+
prompt — the live SQLite DB at `src/wp-content/database/.ht.sqlite`.
58+
It does not touch `node_modules/`, `vendor/`, or build artifacts under
59+
`src/`. For those, use `git clean -fdx`.
4960

5061
## Use `127.0.0.1`, not `localhost`
5162

@@ -58,10 +69,9 @@ macOS/Linux, so a browser hitting `http://localhost:<port>/` can get
5869
| Symptom | Fix |
5970
|---|---|
6071
| `not in a wordpress-develop checkout` | `cd` to the repo root. |
61-
| `extension X not loaded` | Install it. Ubuntu/Debian: `apt install php-sqlite3 php-xml php-zip`. |
72+
| `extension X not loaded` | Install it. Ubuntu/Debian: `apt install php-sqlite3 php-xml php-zip`. Homebrew's `php` already bundles them. |
6273
| `<tool> below minimum` | Upgrade node/npm/composer. |
63-
| `SHA256 mismatch on plugin zip` | Retry once; if persistent, the pinned SQLite drop-in needs an update — file an issue. |
74+
| `SHA256 mismatch on plugin zip` | Retry once. If persistent, the pinned SQLite drop-in needs a deliberate update — file an issue. |
6475
| `failed to bind 127.0.0.1:<port>` | Another process holds the port. `lsof -nP -iTCP:<port> -sTCP:LISTEN`; kill the holder, or `init --port=N` to relocate. |
65-
| Browser hangs / `ECONNREFUSED` on `localhost` | Use `http://127.0.0.1:<port>/`. |
66-
| phpunit `ABSPATH constant ... non-existent path` | You ran with `--no-build` on a fresh checkout. Re-run without it. |
76+
| phpunit fails with deprecation-as-exception in a non-`html-api` group | Only `--group html-api` is the green-bar contract. Other groups may surface deprecations on newer PHP — per-group fix, not envlite's. |
6777
| Corrupt-DB error after an interrupted run | Delete `src/wp-content/database/.ht.sqlite` and re-run. |

0 commit comments

Comments
 (0)