You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Motivation for the change, related issues
This pull request updates the documentation for the `wp-playground-cli`
server command, expanding and clarifying the available command-line
options. The most important changes include the addition of new flags,
improved descriptions for existing options, and important security notes
regarding symlink handling.
**New and updated CLI options:**
* Added a `--php=<version>` option to specify the PHP version, with
supported versions listed and a default of `8.3`.
* Enhanced the `--auto-mount` option to accept an optional path argument
(`--auto-mount[=<path>]`), allowing users to specify which directory to
mount or default to the current working directory. The documentation now
clarifies what types of directories can be mounted.
* Introduced a `--follow-symlinks` flag, enabling Playground to
automatically mount symlinked directories and files within mounted
directories.
* Added a `--quiet` flag to suppress logs and progress messages.
**Security and usage notes:**
* Added a cautionary note about the security implications of using the
`--follow-symlinks` flag, warning that it may expose files outside
mounted directories.
Copy file name to clipboardExpand all lines: packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,9 +169,12 @@ to your unique WordPress setup. With the Playground CLI, you can use the followi
169
169
The `server` command supports the following optional arguments:
170
170
171
171
-`--port=<port>`: The port number for the server to listen on. Defaults to 9400.
172
+
-`--version`: Show version number.
172
173
-`--outfile`: When building, write to this output file.
174
+
-`--site-url=<url>`: Site URL to use for WordPress. Defaults to `http://127.0.0.1:{port}`.
173
175
-`--wp=<version>`: The version of WordPress to use. Defaults to the latest.
174
-
-`--auto-mount`: Automatically mount the current directory (plugin, theme, wp-content, etc.).
176
+
-`--php=<version>`: PHP version to use. Choices: `8.4`, `8.3`, `8.2`, `8.1`, `8.0`, `7.4`, `7.3`, `7.2`. Defaults to `8.3`.
177
+
-`--auto-mount[=<path>]`: Automatically mount a directory. If no path is provided, mounts the current working directory. You can mount a WordPress directory, a plugin directory, a theme directory, a wp-content directory, or any directory containing PHP and HTML files.
175
178
-`--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: `"/host/path:/vfs/path"`.
176
179
-`--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`.
177
180
-`--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"``"/vfs/path"`.
@@ -181,8 +184,17 @@ The `server` command supports the following optional arguments:
181
184
-`--login`: Automatically log the user in as an administrator.
182
185
-`--skip-wordpress-setup`: Do not download or install WordPress. Useful if you are mounting a full WordPress directory.
183
186
-`--skip-sqlite-setup`: Do not set up the SQLite database integration.
184
-
-`--verbosity`: Output logs and progress messages. Choices are "quiet", "normal" or "debug". Defaults to "normal".
187
+
-`--verbosity=<level>`: Output logs and progress messages. Choices: `quiet`, `normal`, `debug`. Defaults to `normal`.
185
188
-`--debug`: Print the PHP error log if an error occurs during boot.
189
+
-`--follow-symlinks`: Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories.
190
+
-`--internal-cookie-store`: Enable internal cookie handling. When enabled, Playground will manage cookies internally using an HttpCookieStore that persists cookies across requests. When disabled, cookies are handled externally (e.g., by a browser in Node.js environments). Defaults to false.
191
+
-`--xdebug`: Enable Xdebug. Defaults to false.
192
+
-`--experimental-devtools`: Enable experimental browser development tools. Defaults to false.
193
+
-`--experimental-multi-worker=<number>`: Enable experimental multi-worker support which requires a `/wordpress` directory backed by a real filesystem. Pass a positive number to specify the number of workers to use. Otherwise, defaults to the number of CPUs minus 1.
194
+
195
+
:::caution
196
+
With the flag `--follow-symlinks`, the following symlinks will expose files outside mounted directories to Playground and could be a security risk.
0 commit comments