Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3c035ae
Merge branch 'master' of github.com:seanmorris/php-wasm
seanmorris Dec 31, 2025
612afe0
iphone bugfix
seanmorris Jan 2, 2026
3e001e1
Tweaks
seanmorris Jan 3, 2026
a2b7b71
Clearing extra files from repo
seanmorris Jan 3, 2026
3959f33
Merge branch 'sm-iphone-demo-bug' into develop
seanmorris Jan 3, 2026
b4ba762
Tweak
seanmorris Jan 3, 2026
3fd3b8e
Extension toggle & mobile tweaks for demo-web app (#93)
seanmorris Jan 3, 2026
e75afdc
Merge branch 'develop' of github.com:seanmorris/php-wasm into develop
seanmorris Jan 3, 2026
f5203ae
Adding INACTIVE indicator for libxml (#95)
seanmorris Jan 3, 2026
d15d506
Adding waitline to CI (#94)
seanmorris Jan 3, 2026
31d6b93
Merge branch 'develop' of github.com:seanmorris/php-wasm into develop
seanmorris Jan 3, 2026
1249d99
Bugfix for shared build test & removing extraneous debug statement.
seanmorris Jan 3, 2026
e28a57e
Apply maximum brotli & gzip compression to .wasm & .so files before p…
seanmorris Jan 3, 2026
bcab874
Serve compressed assets from cloudflare when available
seanmorris Jan 4, 2026
c86acfa
Workflow tweaks
seanmorris Jan 4, 2026
cef7052
Content type correction
seanmorris Jan 4, 2026
589f970
Deploy pages function quickly
seanmorris Jan 4, 2026
8594406
Path tweaks
seanmorris Jan 4, 2026
ae9aa7f
Function tweak
seanmorris Jan 4, 2026
443032d
Function tweak
seanmorris Jan 4, 2026
77304b5
Adding "Cache-Control: no-transform" header
seanmorris Jan 4, 2026
2b4915d
Using encodeBody option in CF Function
seanmorris Jan 4, 2026
309434d
Pre-compress .dat files too
seanmorris Jan 4, 2026
a6a87f0
Suppress attempt to load libxml when it hasn't been provided in share…
seanmorris Jan 4, 2026
bd8b6f8
Adding version & variant options to php-tags.mjs
seanmorris Jan 4, 2026
c2c24d0
Adding cgi-node test & tweaking existing test
seanmorris Jan 5, 2026
dd1ce8e
Testing tweaks
seanmorris Jan 5, 2026
693b497
Test tweaks
seanmorris Jan 5, 2026
fd5fc18
Test tweaks
seanmorris Jan 5, 2026
606133d
Test tweaks
seanmorris Jan 5, 2026
e563c2c
Test tweaks
seanmorris Jan 5, 2026
23726be
Patching phpdbg in 8.2 & 8.4
seanmorris Jan 5, 2026
0a8c5a0
phpdbg updates
seanmorris Jan 8, 2026
3fd762c
Using a weak symbol and a runtime switch instead of macros
seanmorris Jan 8, 2026
15b648f
Allow version switching in phpdbg demo
seanmorris Jan 8, 2026
b00348e
node-cgi-test bugfix for static & shared builds
seanmorris Jan 9, 2026
b55215b
Backtraces & 8.1 in dbg preview
seanmorris Jan 10, 2026
b181e74
Version selector tweak
seanmorris Jan 10, 2026
eacbe64
Switching frames in phpdbg preview demo
seanmorris Jan 10, 2026
7e43872
8.5 builds with errors
seanmorris Feb 1, 2026
a7146ec
patch
seanmorris Feb 1, 2026
b2f7cbe
8.5 runs
seanmorris Feb 1, 2026
71f932e
CI .env files
seanmorris Feb 1, 2026
150fc46
Fixing tidy loader
seanmorris Feb 1, 2026
daaa94f
Fixing phar ext loader
seanmorris Feb 1, 2026
ed708cd
Tweaks.
seanmorris Feb 2, 2026
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
47 changes: 39 additions & 8 deletions .cloudflare/pages/functions/[[path]].js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,43 @@ export const onRequest = async (context) => {
return new Response("Not found", { status: 404 });
}

// return new Response(JSON.stringify({key, exists: !isMissing(obj), obj}));

return new Response(obj.body, {
headers: {
"Content-Type": obj.httpMetadata?.contentType || "application/octet-stream",
"Access-Control-Allow-Origin": "*",
},
});
// Preserve original content-type for use after negotiating compression
const originalContentType = obj.httpMetadata?.contentType || "application/octet-stream";

// Negotiate pre-compressed variants: Brotli preferred, then gzip
const acceptEncoding = context.request.headers.get("Accept-Encoding") || "";
let encoding;

if (acceptEncoding.includes("br")) {
const brKey = key + ".br";
const brObj = await context.env.NIGHTLY_BUILDS.get(brKey);
if (!isMissing(brObj)) {
obj = brObj;
encoding = "br";
}
}

// Fallback to gzip if supported
if (!encoding && acceptEncoding.includes("gzip")) {
const gzKey = key + ".gz";
const gzObj = await context.env.NIGHTLY_BUILDS.get(gzKey);
if (!isMissing(gzObj)) {
obj = gzObj;
encoding = "gzip";
}
}

console.log({originalContentType, encoding});

const headers = {
"Content-Type": originalContentType,
"Access-Control-Allow-Origin": "*",
};
if (encoding) {
headers["Content-Encoding"] = encoding;
headers["Cache-Control"] = "no-transform";
headers["Vary"] = "Accept-Encoding";
}

return new Response(obj.body, { headers, encodeBody: "manual" });
};
1 change: 1 addition & 0 deletions .github/.env_8.0.dynamic.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_WAITLINE=1
WITH_PDO_PGLITE=0
WITH_VRZNO=0
1 change: 1 addition & 0 deletions .github/.env_8.0.shared.ci
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ WITH_ONIGURUMA=shared
WITH_OPENSSL=shared
WITH_INTL=shared

WITH_WAITLINE=1
WITH_PDO_PGLITE=0
WITH_VRZNO=0
1 change: 1 addition & 0 deletions .github/.env_8.0.static.ci
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ WITH_ONIGURUMA=static
WITH_OPENSSL=1
WITH_INTL=static

WITH_WAITLINE=1
WITH_PDO_PGLITE=0
WITH_VRZNO=0
2 changes: 2 additions & 0 deletions .github/.env_8.1.dynamic.ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.1.shared.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=shared
WITH_OPENSSL=shared
WITH_INTL=shared

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.1.static.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=static
WITH_OPENSSL=1
WITH_INTL=static

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.2.dynamic.ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.2.shared.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=shared
WITH_OPENSSL=shared
WITH_INTL=shared

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.2.static.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=static
WITH_OPENSSL=1
WITH_INTL=static

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.3.dynamic.ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.3.shared.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=shared
WITH_OPENSSL=shared
WITH_INTL=shared

WITH_WAITLINE=1
2 changes: 1 addition & 1 deletion .github/.env_8.3.static.ci
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ WITH_ONIGURUMA=static
WITH_OPENSSL=1
WITH_INTL=static


WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.4.dynamic.ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.4.shared.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=shared
WITH_OPENSSL=shared
WITH_INTL=shared

WITH_WAITLINE=1
2 changes: 2 additions & 0 deletions .github/.env_8.4.static.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ WITH_MBSTRING=static
WITH_ONIGURUMA=static
WITH_OPENSSL=1
WITH_INTL=static

WITH_WAITLINE=1
9 changes: 9 additions & 0 deletions .github/.env_8.5.dynamic.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env make
PHP_VERSION=8.5

WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_WAITLINE=1
41 changes: 41 additions & 0 deletions .github/.env_8.5.shared.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env make
PHP_VERSION=8.5

WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_BCMATH=1
WITH_CALENDAR=1
WITH_CTYPE=1
WITH_EXIF=1
WITH_FILTER=1
WITH_TOKENIZER=1

WITH_PHAR=static

WITH_LIBXML=shared
WITH_DOM=dynamic
WITH_XML=dynamic
WITH_SIMPLEXML=dynamic
WITH_TIDY=shared

WITH_LIBZIP=shared
WITH_ICONV=shared
WITH_SQLITE=shared

WITH_GD=static
WITH_ZLIB=shared
WITH_LIBPNG=shared
WITH_FREETYPE=shared
WITH_LIBJPEG=shared
WITH_LIBWEBP=shared

WITH_YAML=shared
WITH_MBSTRING=static
WITH_ONIGURUMA=shared
WITH_OPENSSL=shared
WITH_INTL=shared

WITH_WAITLINE=1
41 changes: 41 additions & 0 deletions .github/.env_8.5.static.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env make
PHP_VERSION=8.5

WITH_SOURCEMAPS=0
ASSERTIONS=0
OPTIMIZE=3
SYMBOLS=0

WITH_BCMATH=1
WITH_CALENDAR=1
WITH_CTYPE=1
WITH_EXIF=1
WITH_FILTER=1
WITH_TOKENIZER=1

WITH_PHAR=static

WITH_LIBXML=static
WITH_DOM=static
WITH_XML=static
WITH_SIMPLEXML=static
WITH_TIDY=static

WITH_LIBZIP=static
WITH_ICONV=static
WITH_SQLITE=static

WITH_GD=static
WITH_ZLIB=static
WITH_LIBPNG=static
WITH_FREETYPE=static
WITH_LIBJPEG=static
WITH_LIBWEBP=static

WITH_YAML=static
WITH_MBSTRING=static
WITH_ONIGURUMA=static
WITH_OPENSSL=1
WITH_INTL=static

WITH_WAITLINE=1
22 changes: 18 additions & 4 deletions .github/bin/index-dirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ TREE_FLAGS='-FCL 1'
cd ${PACKAGES_DIR};

find . -type d | while read DIR; do {
[[ "${DIR::-1}" == "pdo-cfd1" ]] && continue;
[[ "${DIR::-1}" == "pdo-pglite" ]] && continue;
[[ "${DIR::-1}" == "vrzno" ]] && continue;
[[ "${DIR::-1}" == "waitline" ]] && continue;
[[ "${DIR:2}" == "pdo-cfd1" ]] && continue;
[[ "${DIR:2}" == "pdo-pglite" ]] && continue;
[[ "${DIR:2}" == "vrzno" ]] && continue;
[[ "${DIR:2}" == "waitline" ]] && continue;

test -d ${DIR} || continue;
pushd ${DIR} > /dev/null;
Expand All @@ -21,6 +21,20 @@ find . -type d | while read DIR; do {
perl -pi -e "s#^</head>#<style> html { background-color: black; } body { filter: invert(1); } </style></head>#" index.html
perl -pi -e "s#^</p>#at $(date)</p>#" index.html
perl -pi -e "s#\t</p>#\t<br /><br />php-wasm © 2021-$(date +%Y) Sean Morris</p>#" index.html
shopt -s nullglob
for BINARY in *.wasm; do
brotli -kfZ ${BINARY}
gzip -k9 ${BINARY}
done;
for BINARY in *.so; do
brotli -kfZ ${BINARY}
gzip -k9 ${BINARY}
done;
for DAT in *.dat; do
brotli -kfZ ${DAT}
gzip -k9 ${DAT}
done;
shopt -u nullglob
popd > /dev/null;
}; done;

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-step.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ jobs:
- name: Build PHP for Web & PHP-CGI for Worker
run: time make --debug=basic web-mjs worker-cgi-mjs

- name: Build PHP CGI for Node
run: time make --debug=basic node-cgi-mjs

- name: Build php${{ inputs.phpVersion }}-sdl.so
run: time make --debug=basic packages/sdl/php${{ inputs.phpVersion }}-sdl.so packages/sdl/libGL.so PHP_VERSION=${{ inputs.phpVersion }}

Expand Down
Loading