WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.65k stars 263 forks source link

[PHP.wasm] Stream stdout and stderr data to the API consumer instead of buffering it #1946

Open adamziel opened 1 month ago

adamziel commented 1 month ago

PHP.wasm redirects the output streams to files, e.g. /internal/stdout. This is caused by an Emscripten limitation – a null byte in the stdout stream is treated as the end of that stream. Let's find a way for PHP to stream the output data piece by piece – this would unlock faster rendering, streaming data between two Playgrounds, and stream-exporting entire sites as ZIP files without running out of memory.