Skip to content

Commit

Permalink
Merge pull request #284 from danog/php_8.3_sapi
Browse files Browse the repository at this point in the history
Add PHP 8.3, SAPI globals support
  • Loading branch information
danog authored Nov 21, 2023
2 parents 57c53b6 + 116c698 commit 2067c31
Show file tree
Hide file tree
Showing 10 changed files with 831 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: ["8.0", "8.1", "8.2"]
php: ["8.0", "8.1", "8.2", "8.3"]
rust: [stable, nightly]
clang: ["14"]
phpts: [ts, nts]
Expand Down
4 changes: 4 additions & 0 deletions allowed_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bind! {
_efree,
_emalloc,
_zend_executor_globals,
_sapi_globals_struct,
_zend_expected_type,
_zend_expected_type_Z_EXPECTED_ARRAY,
_zend_expected_type_Z_EXPECTED_BOOL,
Expand Down Expand Up @@ -241,6 +242,7 @@ bind! {
zend_class_serialize_deny,
zend_class_unserialize_deny,
zend_executor_globals,
sapi_globals_struct,
zend_objects_store_del,
zend_hash_move_forward_ex,
zend_hash_get_current_key_type_ex,
Expand All @@ -251,10 +253,12 @@ bind! {
gc_possible_root,
ZEND_ACC_NOT_SERIALIZABLE,
executor_globals,
sapi_globals,
php_printf,
__zend_malloc,
tsrm_get_ls_cache,
executor_globals_offset,
sapi_globals_offset,
zend_atomic_bool_store,
zend_interrupt_function,
zend_eval_string,
Expand Down
8 changes: 7 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use bindgen::RustTarget;
use impl_::Provider;

const MIN_PHP_API_VER: u32 = 20200930;
const MAX_PHP_API_VER: u32 = 20220829;
const MAX_PHP_API_VER: u32 = 20230831;

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

const PHP_82_API_VER: u32 = 20220829;

const PHP_83_API_VER: u32 = 20230831;

println!("cargo:rustc-cfg=php80");

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

if version >= PHP_83_API_VER {
println!("cargo:rustc-cfg=php83");
}

Ok(())
}

Expand Down
Loading

1 comment on commit 2067c31

@danog
Copy link
Collaborator Author

@danog danog commented on 2067c31 Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests will pass after PHP 8.3 is released, will re-run CI and make a release in two days.

Please sign in to comment.