-
Notifications
You must be signed in to change notification settings - Fork 362
[Docs] Updating CLI flags list #2812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| - `--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. | ||
| - `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: `"/host/path:/vfs/path"`. | ||
| - `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`. | ||
| - `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also --mount-dir-before-install which corresponds with --mount-dir. These flags were created as alternatives to the --mount and --mount-before-install flags to avoid problems with the : character when mounting paths in Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might even be worth deprecating --mount and --mount-before-install so we can have a single pair of flags that works for all supported platforms. What do you think, @WordPress/playground-maintainers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandonpayton What about?
- `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. **Recommended for cross-platform compatibility** as it avoids issues with the `:` character in Windows paths.
- `--mount-dir-before-install`: Mount a directory before WordPress installation (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. **Recommended for cross-platform compatibility** as it avoids issues with the `:` character in Windows paths.
- `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: `"/host/path:/vfs/path"`. _Note: May have issues with Windows paths containing `:`. Consider using `--mount-dir` instead._
- `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`. _Note: May have issues with Windows paths containing `:`. Consider using `--mount-dir-before-install` instead._
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this was another case where the option was just in the collapsed section of code outside the scope of the PR. I visually scanned for such sections before commenting but somehow missed it.
brandonpayton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this update, @fellyph!
I think we can also add documentation for --blueprint and --blueprint-may-read-adjacent-files flags.
packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md
Outdated
Show resolved
Hide resolved
|
Also, check out this PR which will make the |
|
@brandonpayton |
|
|
Ah, I even tried to look for that. It seemed unlikely those would have been left out. |
brandonpayton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the most recent updates (and clarifying that I'd missed some existing documentation), this looks good to me.
Just to inform you that we are also adding the |
Motivation for the change, related issues
This pull request updates the documentation for the
wp-playground-cliserver 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:
--php=<version>option to specify the PHP version, with supported versions listed and a default of8.3.--auto-mountoption 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.--follow-symlinksflag, enabling Playground to automatically mount symlinked directories and files within mounted directories.--quietflag to suppress logs and progress messages.Security and usage notes:
--follow-symlinksflag, warning that it may expose files outside mounted directories.