Skip to content
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

CLI and networking support #119

Merged
merged 67 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
45c5c54
Explore a generic php-cli npm package that enables running PHP scripts
adamziel Jan 14, 2023
dacb78a
Skip over the shebang line in CLI scripts
adamziel Jan 14, 2023
d431850
Configurable CLI command
adamziel Jan 14, 2023
d09743d
Compile with the actual CLI SAPI
adamziel Jan 14, 2023
0e5e96e
Support PHP-CLI interactive mode
adamziel Jan 16, 2023
48dab7c
Accept arbitrary ENV variables
adamziel Jan 17, 2023
cd7d013
Last steps towards a working CLI build
adamziel Jan 17, 2023
499edd7
Support arbitrary number of CLI args via a linkedlist
adamziel Jan 17, 2023
4cb34d9
Cleanup PHP build dockerfile
adamziel Jan 17, 2023
1c16b4d
Disable unsupported PHP features via initial php.ini values
adamziel Jan 17, 2023
ce92698
Remove a typo from Docekrfile
adamziel Jan 17, 2023
9282cf4
Remove pthreads artifats
adamziel Jan 17, 2023
331f199
Make php_wasm.c compatible with php8
adamziel Jan 17, 2023
ca16273
Fix up dev artifacts
adamziel Jan 17, 2023
5c7b792
Reliable CLI build for PHP 5.6-8.2
adamziel Jan 18, 2023
c7fb1e9
Restrict Node.js specific changes to node runtime
adamziel Jan 18, 2023
88b7e3e
Restore the init() call when dispatching web requests
adamziel Jan 18, 2023
00b7397
Remove dev artifact
adamziel Jan 18, 2023
c6fdba4
Cleanup unused imports
adamziel Jan 18, 2023
47b9c29
Add a build-cli directory for the php-cli builds
adamziel Jan 18, 2023
f115faf
Ignore build-cli
adamziel Jan 18, 2023
118d041
Add php-cli build logic
adamziel Jan 18, 2023
1ac2593
Minify PHP CLI build
adamziel Jan 18, 2023
86a5766
Add a php.ini script and bump the version
adamziel Jan 18, 2023
7c7b31d
Adjust the build script to PHP 8.2 requirements
adamziel Jan 18, 2023
8ef797b
Support popen()
adamziel Jan 19, 2023
594665f
Add pre-build node binaries
adamziel Jan 19, 2023
17ac5a1
Enable exec functions in php.ini and bump the version
adamziel Jan 19, 2023
24f543c
Fix typo in esbuild.js
adamziel Jan 19, 2023
901e009
Add the missing php-cli script
adamziel Jan 20, 2023
5ed82f9
Networking: Patch php's php_pollfd_for() function to yield back to JS…
adamziel Jan 20, 2023
3276c49
Working HTTP traffic (had to implement MSG_SEEK flag for recv())
adamziel Jan 22, 2023
e95b9d3
Working ssl networking!
adamziel Jan 22, 2023
8deeead
Working OpenSSL build and https support
adamziel Jan 23, 2023
c06b9bd
Incorporate new PHP compile options in the gulpfile
adamziel Jan 23, 2023
8e794f1
MySQL support
adamziel Jan 23, 2023
9308900
Networking support for both binary protocols like MySQL and plain HTTP
adamziel Jan 23, 2023
fb6b3e6
Networking setup where WordPress PHPUnit tests run and start passing
adamziel Jan 24, 2023
0ff4562
Asyncify the missing PHP function
adamziel Jan 24, 2023
dcbb26a
Asyncify Pre-PHP8 functions
adamziel Jan 24, 2023
db7874c
Add the missing Emscripten JS library
adamziel Jan 25, 2023
540fa7c
Document Emscripten library functions
adamziel Jan 25, 2023
9f92b8d
Incorporate the WS proxy into the php-cli command
adamziel Jan 25, 2023
9afb85a
Automatically provide PHP with the CA chain
adamziel Jan 25, 2023
dcc292a
Lint network proxy
adamziel Jan 25, 2023
e0239b4
Remove dev artifacts from php.ts
adamziel Jan 25, 2023
de4e4fd
Remove development artifacts
adamziel Jan 25, 2023
6538cf6
Remove dev artifacts
adamziel Jan 25, 2023
7a9824b
Remove development artifacts
adamziel Jan 25, 2023
e6c24c7
Adjust unit tests
adamziel Jan 25, 2023
0a2ce85
Experimental support for PHP 5.6
adamziel Jan 26, 2023
84b80c3
Add the missing PHP 5.6 openssl patch
adamziel Jan 26, 2023
cf402a0
Clean up the Dockerfile and tests
adamziel Jan 26, 2023
cbc7977
Restore --with-zlib-path to Dockerfile and remove a debug statement
adamziel Jan 27, 2023
2d31d5c
Further cleanup the Dockerfile
adamziel Jan 27, 2023
93927ea
Error out from the build process if any replace or patch fails to apply
adamziel Jan 27, 2023
2048a35
Solve last compilation kinks – it all works now!
adamziel Jan 27, 2023
20dda3c
Updated WASM files
adamziel Jan 27, 2023
4949e87
Remove TERMINFO override
adamziel Jan 27, 2023
dc54afa
Exit the CLI node.js process once the PHP runtime exits
adamziel Jan 30, 2023
ebd9479
Allowlist a missing PHP 7.0 Asyncify function
adamziel Jan 30, 2023
ec39ba4
Remove the commented php.ini options
adamziel Jan 30, 2023
37da784
Exit the php-cli process on error
adamziel Jan 30, 2023
1d21d5b
Rebuild PHP 7.0 and 7.1
adamziel Jan 30, 2023
d4418fc
Add the missing newline at the end of build-cli/package.json
adamziel Jan 30, 2023
100c5f3
Bump the cli package version
adamziel Jan 30, 2023
a626d1a
Add ws as a php-cli dependency
adamziel Jan 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/**/*
build/*
packages/*/build*/*
src/php-wasm/wasm/build-assets/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
node_modules
package-lock.json
build/*
build-cli/*
build-api
build-wp
build-php
Expand Down
Empty file added build-cli/.gitkeep
Empty file.
24 changes: 24 additions & 0 deletions build-cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "php-cli",
"version": "0.1.4",
"description": "PHP CLI via WebAssembly. Part of WordPress Playground.",
"main": "php-cli.js",
"author": "The WordPress contributors",
"contributors": [
{
"name": "Adam Zielinski",
"email": "[email protected]",
"url": "https://github.com/adamziel"
}
],
"license": "Apache-2.0",
"dependencies": {
"ws": "^8.12.0"
},
"bin": "php-cli.js",
"repository": {
"type": "git",
"url": "https://github.com/WordPress/wordpress-playground"
},
"homepage": "https://developer.wordpress.org/playground"
}
13 changes: 13 additions & 0 deletions build-cli/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error_reporting=E_ALL
display_errors=1
html_errors=1
display_startup_errors=On
log_errors=1
always_populate_raw_post_data=-1
upload_max_filesize=2000M
post_max_size=2000M
disable_functions=proc_open,popen,curl_exec,curl_multi_exec
allow_url_fopen=On
session.save_path=/home/web_user
implicit_flush=1
output_buffering=0
6 changes: 4 additions & 2 deletions build/php-5.6.js

Large diffs are not rendered by default.

Loading