Inside this repository¶
Everything that compiles PHP is in docker/, everything else drives it:
docker/Dockerfilecompiles PHP to WebAssembly, with emscripten. The PHP version, the extensions and the directory to embed are its build arguments. It builds two files for each target,php-web.mjsandphp-web.wasmfor the browser,php-node.mjsandphp-node.wasmfor node, andphp-sw.jsfor the service worker of a page.run.cruns PHP, andwarm.mjsrunsWARMUPwhen it is built.- The
.mjsfile is the JavaScript API, fromdocker/api.js:createPhp()starts PHP,runFile(),runCode()andrequest()run it.docker/worker.jsruns it in a worker, anddocker/frame.js, withdocker/php-sw.js, shows an application in a frame. - A stack names a set of build arguments, in PHP (see Stacks).
stacks.phphas the builds that this repository checks, in CI too, and castor builds them with the tasks ofcastor.php, from the functions ofsrc/. A project that requires the package declares its own stack, the same way (see Use it in your project). examples/has the pages of the examples, each laid out as a project of your own would be: its stack instack.php, what the browser loads inpublic/, and the PHP code it embeds inapp/(see The examples).node/run.mjsruns a PHP file, or some PHP code, with node, andnode/fetch-files.mjslets node run the modules of a page as a browser does, to test them (see Check it).tests/has the tests of the JavaScript API.docs/is this documentation, in Markdown, andzensical.tomlmakes it a website, with the template of the home page indocs/.overrides/(see The examples).