From 26d231933a5300ff40985d3e49d14f1bc5f0f6bf Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Thu, 10 Jul 2025 18:59:32 +0800 Subject: [PATCH] chore: unfork ext-php-rs With this, we are now using the mainline ext-php-rs. All features have been upstreamed at this point, so we can archive our fork. --- .cargo/config.toml | 2 ++ crates/php/Cargo.toml | 3 +-- crates/php/src/sapi.rs | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..b1989ac --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +EXT_PHP_RS_ALLOWED_BINDINGS = "php_execute_script,sapi_send_headers,sapi_get_default_content_type,php_register_variable,SAPI_OPTION_NO_CHDIR" diff --git a/crates/php/Cargo.toml b/crates/php/Cargo.toml index 79f3fed..fd1cf67 100644 --- a/crates/php/Cargo.toml +++ b/crates/php/Cargo.toml @@ -14,8 +14,7 @@ path = "src/main.rs" [dependencies] bytes = "1.10.1" hostname = "0.4.1" -ext-php-rs = { git = "https://github.com/platformatic/ext-php-rs.git" } -# ext-php-rs = { path = "../../../ext-php-rs" } +ext-php-rs = { version = "0.14.0", features = ["embed"] } lang_handler = { path = "../lang_handler", features = ["napi"] } libc = "0.2.171" once_cell = "1.21.0" diff --git a/crates/php/src/sapi.rs b/crates/php/src/sapi.rs index 1ca04da..129e4f3 100644 --- a/crates/php/src/sapi.rs +++ b/crates/php/src/sapi.rs @@ -10,10 +10,11 @@ use bytes::Buf; use ext_php_rs::{ alloc::{efree, estrdup}, builders::SapiBuilder, - embed::SapiModule, + embed::{ + ext_php_rs_sapi_per_thread_init, ext_php_rs_sapi_shutdown, ext_php_rs_sapi_startup, SapiModule, + }, // exception::register_error_observer, ffi::{ - ext_php_rs_sapi_per_thread_init, ext_php_rs_sapi_shutdown, ext_php_rs_sapi_startup, php_module_shutdown, php_module_startup, php_register_variable, sapi_send_headers, sapi_shutdown, sapi_startup, ZEND_RESULT_CODE_SUCCESS, },