speedyspec-php
Embedded, statically linked PHP interpreter for speedyspec.
Part of the SpeedySpec platform.
Role: platform. Seam: container.
What it gives you
Php::boot: starts the embedded interpreter once per process, with the hook registry and native areas inBootOptions.Php::eval,Php::call,Php::requireandPhp::serve: run code, call callables, load files and serve aWebRequest.NativeArea: a set of native functions and classes, with request start and end hooks.DOCS_RS:build.rslinks nothing when it is set, so docs.rs builds the docs without a PHP.
Install
Requirements
A static PHP built by scripts/build-php.sh at speedyspec-php's pinned php-version, with SPEEDYSPEC_PHP_PREFIX, PHP, PHP_CONFIG and SODIUM_LIB_DIR set. Rust 1.99.
Features
embed(on by default) links the embedded PHP. It is required to run PHP; without it,Php::bootreturns an error. It is off only for docs.rs builds, whose ext-php-rs bindings cannot build it.
Example
Boot PHP and evaluate an expression.
use Rc;
use Value;
use MemoryHooks;
use ;
let php = boot
.expect;
assert_eq!;
Where it fits
Every crate that runs PHP builds on this one: speedyspec-php-ext for the extension's shared parts,
speedyspec-container-php and speedyspec-wp-hooks-php for their areas, and the runtime itself. The pinned PHP
version ships in the package as php-version, and a consumer's build-php.sh reads it from the package it
resolved.
Versioning
SemVer, 0.x: a minor version may break the API. MSRV is Rust 1.99. SpeedySpec's own version (ADR-028) is the PHP runtime's major, not this crate's.
License
MIT