Skip to content

[Playground CLI] Use Blueprints v2 - #2238

Closed
adamziel wants to merge 29 commits into
trunkfrom
integrate-blueprints-v2-with-playground-cli
Closed

[Playground CLI] Use Blueprints v2 #2238
adamziel wants to merge 29 commits into
trunkfrom
integrate-blueprints-v2-with-playground-cli

Conversation

@adamziel

@adamziel adamziel commented Jun 5, 2025

Copy link
Copy Markdown
Collaborator

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 mentioned this pull request Jun 16, 2025
1 task
@adamziel adamziel closed this Jun 16, 2025
@adamziel

Copy link
Copy Markdown
Collaborator Author

superseded by #2281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment