Skip to content

Commit 27a8f3d

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

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/embed/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +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)]
8688
in_list: false,
89+
#[cfg(not(php81))]
90+
free_filename: false,
8791
buf: null_mut(),
8892
len: 0,
8993
};
@@ -96,8 +100,11 @@ impl Embed {
96100

97101
match exec_result {
98102
Err(_) => Err(EmbedError::CatchError),
103+
#[cfg(not(php82))]
104+
Ok(0) => Ok(()),
105+
#[cfg(php82)]
99106
Ok(true) => Ok(()),
100-
Ok(false) => Err(EmbedError::ExecuteScriptError),
107+
Ok(_) => Err(EmbedError::ExecuteScriptError),
101108
}
102109
}
103110

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)