• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

davidcole1340 / ext-php-rs / 16323306954

16 Jul 2025 03:10PM UTC coverage: 22.222% (+0.6%) from 21.654%
16323306954

Pull #482

github

web-flow
Merge de76d2402 into 1166e2910
Pull Request #482: feat(cargo-php)!: escalate privilege and to copy extension and edit ini file

0 of 48 new or added lines in 1 file covered. (0.0%)

193 existing lines in 10 files now uncovered.

870 of 3915 relevant lines covered (22.22%)

3.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/zend/mod.rs
1
//! Types used to interact with the Zend engine.
2

3
mod _type;
4
pub mod ce;
5
mod class;
6
mod ex;
7
mod function;
8
mod globals;
9
mod handlers;
10
mod ini_entry_def;
11
mod linked_list;
12
mod module;
13
mod streams;
14
mod try_catch;
15

16
use crate::{
17
    error::Result,
18
    ffi::{php_printf, sapi_module},
19
};
20
use std::ffi::CString;
21

22
pub use _type::ZendType;
23
pub use class::ClassEntry;
24
pub use ex::ExecuteData;
25
pub use function::Function;
26
pub use function::FunctionEntry;
27
pub use globals::ExecutorGlobals;
28
pub use globals::FileGlobals;
29
pub use globals::ProcessGlobals;
30
pub use globals::SapiGlobals;
31
pub use globals::SapiHeader;
32
pub use globals::SapiHeaders;
33
pub use globals::SapiModule;
34
pub use handlers::ZendObjectHandlers;
35
pub use ini_entry_def::IniEntryDef;
36
pub use linked_list::ZendLinkedList;
37
pub use module::ModuleEntry;
38
pub use streams::*;
39
#[cfg(feature = "embed")]
40
pub(crate) use try_catch::panic_wrapper;
41
pub use try_catch::{bailout, try_catch, try_catch_first, CatchError};
42

43
// Used as the format string for `php_printf`.
44
const FORMAT_STR: &[u8] = b"%s\0";
45

46
/// Prints to stdout using the `php_printf` function.
47
///
48
/// Also see the [`php_print`] and [`php_println`] macros.
49
///
50
/// # Arguments
51
///
52
/// * message - The message to print to stdout.
53
///
54
/// # Errors
55
///
56
/// * If the message could not be converted to a [`CString`].
UNCOV
57
pub fn printf(message: &str) -> Result<()> {
×
58
    let message = CString::new(message)?;
×
59
    unsafe {
60
        php_printf(FORMAT_STR.as_ptr().cast(), message.as_ptr());
×
61
    };
UNCOV
62
    Ok(())
×
63
}
64

65
/// Get the name of the SAPI module.
66
///
67
/// # Panics
68
///
69
/// * If the module name is not a valid [`CStr`]
70
///
71
/// [`CStr`]: std::ffi::CStr
72
pub fn php_sapi_name() -> String {
×
UNCOV
73
    let c_str = unsafe { std::ffi::CStr::from_ptr(sapi_module.name) };
×
UNCOV
74
    c_str.to_str().expect("Unable to parse CStr").to_string()
×
75
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc