最近更新的页面
Compiling PHP
The build pipeline lives in a Dockerfile. It was originally forked from seanmorris/php-wasm In b...
Asyncify and JSPI: Stack Switching in PHP WebAssembly
Asyncify lets synchronous C or C++ code interact with asynchronous JavaScript. Technically, it sa...
Bundling WordPress for the browser
The web bundler Dockerfile turns a vanilla WordPress into a browser-optimized one: Makes WordPres...
Browser tab orchestrates the execution
The main index.html ties the entire application together. It starts all the concurrent processes...
Service Workers
A Service Worker is used to handle the HTTP traffic using the in-browser PHPRequestHandler. Imag...
Scopes
Scopes keep your app working when you open it in two different browser tabs. The Service Worker p...
PHP Worker Threads
PHP is always ran in a web worker to ensure the PHP runtime doesn’t slow down the user interface ...
Iframe-based rendering
To avoid page reloads, all the PHPRequestHandler responses must be rendered in an iframe. Rememb...
Cross-process communication
@php-wasm/web uses the Comlink library to turns the one-way postMessage available in JavaScript ...
Running PHP apps in the browser with ServiceWorkers and Worker Threads
On a high level, WordPress Playground works in web browsers as follows: The index.html file on p...
Playground API Client
The PlaygroundClient object implements the UniversalPHP interface. All the methods from that in...
Loading PHP extensions
PHP reads extension declarations while it starts. In PHP.wasm, that means extensions must be decl...
PHP extension dependencies
Custom PHP.wasm extensions can only link WebAssembly code built with the same Emscripten toolchai...
Mount data
Mount a directory from the browser You can mount a directory from the browser to Playground using...
`remote.html` vs `index.html`
playground.wordpress.net exposes two distinct APIs through two separate HTML files: remote.html ...
Building PHP extensions
Use @php-wasm/compile-extension when you have a phpize extension source directory and want a di...
Blueprints JSON and the API Client
The Playground API client can be initialized with a JSON Blueprint. This is a convenient way of p...
User Roles and Capabilities
If your plugin allows users to submit data—be it on the Admin or the Public side—it should check ...
Sanitizing Data
Untrusted data comes from many sources (users, third party sites, even your own database!) and al...
Nonces
A nonce is a “number used once” to help protect URLs and forms from certain types of misuse, mali...