-
Notifications
You must be signed in to change notification settings - Fork 354
[CLI] Add --wordpress-install-mode flag #2803
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
base: trunk
Are you sure you want to change the base?
Conversation
## Motivation for the change, related issues Part of #2202 Add Japanese translations to JavaScript API
## Motivation for the change, related issues Importing WXR content with URL rewriting enabled replaces the protocol in some URLs from `https` to `http`. ## Implementation details Sets `$_SERVER['HTTPS'] = "on"` in the `importWxr` Blueprint step. The `php.run()` method called in the `importWxr` step does not set it automatically – that's a role of the request handler. The WXR importer relies on the `get_site_url()` WordPress function, which weirdly takes the `site_url` option and replaces the protocol based on the `$_SERVER['https']` value. ## Testing Instructions (or ideally a Blueprint) Import this WXR file via `?importWxr` query parameter and confirm all the URLs are https: https://gist.github.com/adamziel/a3d1a1941608e068e4b3d557ee2e8202/raw/aa659a130e1104cedeea8a63155a117dcb693dc8/tt25export.xml The tricky part is, you need to serve Playground on a https url for this to work. cc @bph
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 are some failing tests, but this reads well to me. Thank you, @adamziel!
| - `--blueprint-may-read-adjacent-files`: Consent flag: Allow "bundled" resources in a local blueprint to read files in the same directory as the blueprint file. | ||
| - `--login`: Automatically log the user in as an administrator. | ||
| - `--skip-wordpress-setup`: Do not download or install WordPress. Useful if you are mounting a full WordPress directory. | ||
| - `--wordpress-install-mode <mode>`: Control how Playground prepares WordPress before booting. Defaults to `download-and-install`. Other options: `install-from-existing-files` (install using files you've mounted), `install-from-existing-files-if-needed` (skip setup when an existing site is detected), and `do-not-attempt-installing` (never download or install WordPress). |
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.
These are lovely, clear option names!
| * just as the web request layer would. | ||
| */ | ||
| HTTPS: (await playground.absoluteUrl).startsWith('https://') ? 'on' : '', | ||
| }, |
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.
@adamziel Is change intentional as part of this PR?
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! It got intertwined, a rebase will solve it – that's already merged into trunk
Motivation for the change, related issues
Studio noted they can't easily used a local, unzipped WordPress directory:
This PR separates skipping the download from skipping the installation.
Implementation
This PR adds a new CLI option called
--wordpress-install-modewith the following supported values:Supersedes #2786
Testing instructions
Run
cc @bcotrim @brandonpayton