Skip to content

Commit 2067c31

Browse files
authored
Merge pull request #284 from danog/php_8.3_sapi
Add PHP 8.3, SAPI globals support
2 parents 57c53b6 + 116c698 commit 2067c31

File tree

10 files changed

+831
-100
lines changed

10 files changed

+831
-100
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
php: ["8.0", "8.1", "8.2"]
18+
php: ["8.0", "8.1", "8.2", "8.3"]
1919
rust: [stable, nightly]
2020
clang: ["14"]
2121
phpts: [ts, nts]

allowed_bindings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bind! {
2626
_efree,
2727
_emalloc,
2828
_zend_executor_globals,
29+
_sapi_globals_struct,
2930
_zend_expected_type,
3031
_zend_expected_type_Z_EXPECTED_ARRAY,
3132
_zend_expected_type_Z_EXPECTED_BOOL,
@@ -241,6 +242,7 @@ bind! {
241242
zend_class_serialize_deny,
242243
zend_class_unserialize_deny,
243244
zend_executor_globals,
245+
sapi_globals_struct,
244246
zend_objects_store_del,
245247
zend_hash_move_forward_ex,
246248
zend_hash_get_current_key_type_ex,
@@ -251,10 +253,12 @@ bind! {
251253
gc_possible_root,
252254
ZEND_ACC_NOT_SERIALIZABLE,
253255
executor_globals,
256+
sapi_globals,
254257
php_printf,
255258
__zend_malloc,
256259
tsrm_get_ls_cache,
257260
executor_globals_offset,
261+
sapi_globals_offset,
258262
zend_atomic_bool_store,
259263
zend_interrupt_function,
260264
zend_eval_string,

build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bindgen::RustTarget;
1616
use impl_::Provider;
1717

1818
const MIN_PHP_API_VER: u32 = 20200930;
19-
const MAX_PHP_API_VER: u32 = 20220829;
19+
const MAX_PHP_API_VER: u32 = 20230831;
2020

2121
pub trait PHPProvider<'a>: Sized {
2222
/// Create a new PHP provider.
@@ -228,6 +228,8 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
228228

229229
const PHP_82_API_VER: u32 = 20220829;
230230

231+
const PHP_83_API_VER: u32 = 20230831;
232+
231233
println!("cargo:rustc-cfg=php80");
232234

233235
if (PHP_81_API_VER..PHP_82_API_VER).contains(&version) {
@@ -238,6 +240,10 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
238240
println!("cargo:rustc-cfg=php82");
239241
}
240242

243+
if version >= PHP_83_API_VER {
244+
println!("cargo:rustc-cfg=php83");
245+
}
246+
241247
Ok(())
242248
}
243249

0 commit comments

Comments
 (0)