pub struct RiphtSapi { /* private fields */ }Expand description
PHP SAPI instance. Initialize once, execute scripts repeatedly.
Implementations§
Source§impl RiphtSapi
impl RiphtSapi
Sourcepub fn configure(config: SapiConfig) -> Result<(), SapiError>
pub fn configure(config: SapiConfig) -> Result<(), SapiError>
Apply custom SAPI configuration before the first RiphtSapi::instance() call.
Must be called before PHP is initialized. Returns
SapiError::AlreadyInitialized if PHP is already running or
SapiError::AlreadyConfigured if configure was already called.
Call this from a single thread during startup. configure and
instance are not internally synchronized against each other: a
configure racing a concurrent instance may be silently ignored
(the engine reads defaults before the config lands). This matches the
non-ZTS, single-threaded-init contract of the crate.
pub fn instance() -> Self
Sourcepub fn shutdown()
pub fn shutdown()
Shuts down the PHP engine. Calling execute() after this is undefined behavior.
pub fn set_ini( &self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, ) -> Result<(), SapiError>
pub fn get_ini(&self, key: &str) -> Option<String>
pub fn executor(&self) -> Result<Executor<'_>, SapiError>
pub fn execute( &self, ctx: ExecutionContext, ) -> Result<ExecutionResult, ExecutionError>
pub fn execute_streaming<F>( &self, ctx: ExecutionContext, on_output: F, ) -> Result<ExecutionResult, ExecutionError>
pub fn execute_with_hooks<H: ExecutionHooks + 'static>( &self, ctx: ExecutionContext, hooks: H, ) -> Result<ExecutionResult, ExecutionError>
pub fn is_initialized(&self) -> bool
Auto Trait Implementations§
impl !Send for RiphtSapi
impl !Sync for RiphtSapi
impl Freeze for RiphtSapi
impl RefUnwindSafe for RiphtSapi
impl Unpin for RiphtSapi
impl UnsafeUnpin for RiphtSapi
impl UnwindSafe for RiphtSapi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more