Expand description
Shared memory bridge — bidirectional PHP ↔ JSC communication.
§PHP → JSC (bext_render)
PHP: $html = bext_render(“Dashboard”, ‘{“orders”:42}’) → C FFI → Rust → JSC pool → HTML → PHP
§JS → PHP (php_call)
JS: const data = bext.php(“GET”, “/api/products”, ‘{“category”:“Books”}’) → Rust → PHP worker pool → JSON → JS
Both directions use the same process memory — no HTTP, no sockets.
Structs§
- PhpCall
Result - Result of a JS→PHP call.
Traits§
- JscBridge
- Trait abstracting the JSC render pool so bext-php doesn’t depend on bext-core.
- PhpBridge
- Trait abstracting the PHP pool so JSC/Bun can call PHP.
Functions§
- has_
jsc_ bridge - Check if a JSC bridge is available.
- has_
php_ bridge - Check if a PHP bridge is available.
- jsc_
render - Render via the JSC bridge. Called from the C SAPI’s
bext_render()function. - jsc_
render_ component - Render a named component via the JSC bridge.
- php_
call - Call PHP from JS. Returns (status, body, content_type).
- set_
jsc_ bridge - Register the JSC pool for PHP threads to use. Called once at server startup after the JSC pool is initialized.
- set_
php_ bridge - Register the PHP pool for JS threads to use.