We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4186cc4 + 23dcef8 commit e1851e5Copy full SHA for e1851e5
src/zend/mod.rs
@@ -11,7 +11,10 @@ mod ini_entry_def;
11
mod module;
12
mod try_catch;
13
14
-use crate::{error::Result, ffi::php_printf};
+use crate::{
15
+ error::Result,
16
+ ffi::{php_printf, sapi_module},
17
+};
18
use std::ffi::CString;
19
20
pub use _type::ZendType;
@@ -51,3 +54,9 @@ pub fn printf(message: &str) -> Result<()> {
51
54
};
52
55
Ok(())
53
56
}
57
+
58
+/// Get the name of the SAPI module.
59
+pub fn php_sapi_name() -> String {
60
+ let c_str = unsafe { std::ffi::CStr::from_ptr(sapi_module.name) };
61
+ c_str.to_str().expect("Unable to parse CStr").to_string()
62
+}
0 commit comments