Skip to content

[Playground CLI] Use Blueprints v2 #2238

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

Closed
wants to merge 29 commits into from

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Jun 5, 2025

This is a first stab at running Blueprints.phar in Playground CLI. It seems to be correctly installing the WordPress site 🎉

Summary of changes

  • Support PHP CLI SAPI with customizable cwd, env variables, and post_message_to_js()
  • Support stdout and stderr streaming
  • Low-level poll(2) compat improvements
  • Low-level TTY compat improvements
  • Remove most WordPress-related logic from CLI as it’s now handled by the v2 runner

cc @bgrgicak @akirk @adamziel @wojtekn

adamziel added 7 commits June 5, 2025 01:09
Functions like proc_open,popen,curl_exec,curl_multi_exec were not
supported long time ago, but now they are. There's no good reason to
disable them by default anymore. Therefore, let's enable them.
This is a first stab at running Blueprints.phar in Playground CLI. It
seems to be correctly installing the WordPress site.

Some of these items might be better suited for other PRs.

* Code structure – Make the spawn handler generic, move it to some
  useful package.
* Clearly separate bootWordPress from bootRequestHandler. Perhaps
  relocate the latter.
* Fix playground.cli() method to avoid mocking cliBootstrapScript inline
* Report Blueprint runner progress live, not after the work is done. We
  may need a callback or a ReadableStream to get the stdout bytes live.
* Find a way of telling the PHP instance what is the current CWD (to
  avoid the chdir() call)
* Propagate CLI args / site URL to runV2() call

cc @bgrgicak @akirk
adamziel added 18 commits June 6, 2025 14:52
…prints.phar reject the CLI args – just the error message.
Use custom decides at /internal/stdout, /internal/stderr, and /internal/headers to expose the PHP output data before the request finishes. Introduce a StreamedPHPResponse class to consume that data as promises and ReadableStream instances
@adamziel adamziel changed the base branch from php-wasm-support-any-php-subprocess to trunk June 11, 2025 12:21
@adamziel adamziel closed this Jun 16, 2025
@adamziel
Copy link
Collaborator Author

superseded by #2281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

1 participant