Skip to content

Commit 4fd40a3

Browse files
committed
feat(embed): fix php signature for embed
1 parent a66fc3f commit 4fd40a3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/embed/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ impl Embed {
8282
filename: null_mut(),
8383
opened_path: null_mut(),
8484
type_: 0,
85+
#[cfg(php81)]
8586
primary_script: false,
87+
#[cfg(php81)]
88+
in_list: false,
89+
#[cfg(not(php81))]
90+
free_filename: false,
8691
in_list: false,
8792
buf: null_mut(),
8893
len: 0,
@@ -96,8 +101,11 @@ impl Embed {
96101

97102
match exec_result {
98103
Err(_) => Err(EmbedError::CatchError),
104+
#[cfg(not(php82))]
105+
Ok(0) => Ok(()),
106+
#[cfg(php82)]
99107
Ok(true) => Ok(()),
100-
Ok(false) => Err(EmbedError::ExecuteScriptError),
108+
Ok(_) => Err(EmbedError::ExecuteScriptError),
101109
}
102110
}
103111

tests/sapi.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ fn test_sapi() {
4444
}
4545

4646
unsafe {
47+
#[cfg(not(php82))]
48+
php_module_startup(sapi, module, 1);
49+
#[cfg(php82)]
4750
php_module_startup(sapi, module);
4851
}
4952

0 commit comments

Comments
 (0)