- Notifications
You must be signed in to change notification settings - Fork 295
CLI and networking support #119
New issue
Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.
By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on ? Sign in to your account
Conversation
Is there a discussion of where these es come from or why they are what they are? Is there a reason they have to be here vs. in a fork of the upstream projects? I saw es to SSL, which you know, catches the eye. |
Here's some discussion started about the es: Propose PRs for the projects that are now ed ad-hoc. |
As @eliot-akira mentioned, I'd love to merge these es to the upstream projects. I will open Pull Requests for actively maintained projects like Emscripten. Unfortunately, PHP 5.6 and some friends are not getting new releases anymore. The OpenSSL you've mentioned is actually a PHP 5.6 to add OpenSSL 1.1.0 support. It's been proposed for upstream PHP 5.6 and rejected. AFAIK most webhosts who still support PHP 5.6 are maintaining their own fork to keep applying security es. Here's the overview of all the es:
|
Let's merge this one and keep iterating in subsequent PRs |
### Description Adds support for CLI SAPI and networking in node.js: ``` > npm run build > node ./build-cli/php-cli.js -r 'echo "Hello from PHP !";' Hello from PHP ! > node ./build-cli/php-cli.js -r 'echo substr(file_get_contents("https://wordpress.org"), 0, 16);' <!DOCTYPE html> > node ./build-cli/php-cli.js -r 'echo phpversion();' 8.2.0-dev > PHP=5.6 node ./build-cli/php-cli.js -r 'echo phpversion();' 5.6.40 ``` ### Highlights: * Networking is supported (including MySQL and HTTPS) * Switching PHP versions is supported. * [Most WordPress PHPUnit tests pass](WordPress/wordpress-playground#111). The failures are caused by missing extensions and a few misconfigured settings * PHP Interactive mode is supported but [the arrow keys don't work](WordPress/wordpress-playground#118) * `wp-cli` works ### In broad strokes: * CLI SAPI is compiled with libedit (readline replacement) and ncurses. * Network calls are asynchronous. Emscripten's Asyncify enables calling asynchronous code from synchronous code. TCP sockets are shimmed with a WebSocket connection to a built-in proxy server running on localhost. It supports data transfer, arbitrary connection targets, and setting a few TCP socket options. * PHP's OpenSSL uses the same CA certs as Node.js * PHP 5.6 is ed to work with OpenSSL 1.1.0 and many other small es are introduced. For more details, see [es overview](WordPress/wordpress-playground#119 (comment)), Dockerfile, and `phpwasm-emscripten-library.js` ### Future work: * PHP Interactive server isn't supported yet. Adding support is a matter of making the incoming connection polling non-blocking using Asyncify. * Use a more recent OpenSSL version * [Better support for CLI interactive mode](WordPress/wordpress-playground#118)
## Motivation for the change, related issues We want to be using the latest Playground updates on WordPress.com. Let's allow public access to our private Playground instance. ## Implementation details This PR comments out the portions of our deployment script that enforce privacy. Those portions are left in place for now to document this decision. ## Testing Instructions (or ideally a Blueprint) - CI - Deploy after merging.
Description
Adds support for CLI SAPI and networking in node.js:
Highlights:
wp-cli
worksIn broad strokes:
phpwasm-emscripten-library.js
Future work: