pub struct PhpState { /* private fields */ }Expand description
Central state for the embedded PHP runtime.
Manages the PHP module lifecycle and worker pool. Added to bext-server’s
AppState behind #[cfg(feature = "php")].
Implementations§
Source§impl PhpState
impl PhpState
Sourcepub fn init(config: PhpConfig) -> Result<Self>
pub fn init(config: PhpConfig) -> Result<Self>
Initialize the PHP runtime and create the worker pool.
Returns Ok even if PHP is disabled by config (pool will be None).
Sourcepub fn execute(
&self,
request_path: &str,
method: &str,
uri: &str,
query_string: &str,
content_type: Option<&str>,
body: Vec<u8>,
cookies: Option<&str>,
headers: Vec<(String, String)>,
remote_addr: Option<&str>,
server_name: Option<&str>,
server_port: u16,
https: bool,
) -> Option<PhpResponse>
pub fn execute( &self, request_path: &str, method: &str, uri: &str, query_string: &str, content_type: Option<&str>, body: Vec<u8>, cookies: Option<&str>, headers: Vec<(String, String)>, remote_addr: Option<&str>, server_name: Option<&str>, server_port: u16, https: bool, ) -> Option<PhpResponse>
Execute a PHP request through the pool.
Resolves the script path from the request URI, then dispatches to a
worker. Returns None if PHP is not active or the path doesn’t
resolve to a PHP file.
Sourcepub fn stats(&self) -> PhpPoolStats
pub fn stats(&self) -> PhpPoolStats
Get pool statistics.
Sourcepub fn status_json(&self) -> Value
pub fn status_json(&self) -> Value
Get status summary as JSON.
Sourcepub fn prometheus_metrics(&self) -> String
pub fn prometheus_metrics(&self) -> String
Get Prometheus metrics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhpState
impl !RefUnwindSafe for PhpState
impl Send for PhpState
impl Sync for PhpState
impl Unpin for PhpState
impl UnsafeUnpin for PhpState
impl !UnwindSafe for PhpState
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