diff --git a/Cargo.lock b/Cargo.lock index ae665eb7..4a67fb7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,17 +26,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "async-trait" -version = "0.1.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -51,13 +40,13 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.9" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" dependencies = [ - "async-trait", "axum-core", "bytes", + "form_urlencoded", "futures-util", "http", "http-body", @@ -85,11 +74,10 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" dependencies = [ - "async-trait", "bytes", "futures-util", "http", @@ -127,16 +115,14 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" -version = "0.69.5" +version = "0.71.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" dependencies = [ "bitflags", "cexpr", "clang-sys", "itertools", - "lazy_static", - "lazycell", "log", "prettyplease", "proc-macro2", @@ -145,7 +131,6 @@ dependencies = [ "rustc-hash", "shlex", "syn", - "which", ] [[package]] @@ -201,12 +186,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "cookie" version = "0.18.1" @@ -263,14 +242,21 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.18" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn", ] @@ -331,7 +317,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "888aa43e6b500bb98788503b19ec2bafc9de5c4e1e513b84ecfc9d2d34ccd2e8" dependencies = [ - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -470,15 +456,6 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "http" version = "1.2.0" @@ -765,9 +742,9 @@ checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -788,18 +765,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.169" @@ -818,9 +783,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" @@ -852,9 +817,9 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "memchr" @@ -1027,7 +992,7 @@ dependencies = [ "phper-build", "phper-macros", "phper-sys", - "thiserror", + "thiserror 2.0.9", ] [[package]] @@ -1051,7 +1016,7 @@ version = "0.14.1" dependencies = [ "phper", "reqwest", - "thiserror", + "thiserror 2.0.9", ] [[package]] @@ -1077,7 +1042,7 @@ dependencies = [ "phper", "phper-test", "reqwest", - "thiserror", + "thiserror 2.0.9", ] [[package]] @@ -1089,7 +1054,7 @@ dependencies = [ "phper", "phper-test", "reqwest", - "thiserror", + "thiserror 2.0.9", "tokio", ] @@ -1117,7 +1082,6 @@ version = "0.14.1" dependencies = [ "bindgen", "cc", - "home", "regex", ] @@ -1309,24 +1273,15 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ "bitflags", "errno", @@ -1416,20 +1371,14 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", ] -[[package]] -name = "semver" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" - [[package]] name = "serde" version = "1.0.217" @@ -1614,7 +1563,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", ] [[package]] @@ -1628,6 +1586,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "time" version = "0.3.37" @@ -1936,18 +1905,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "windows-registry" version = "0.2.0" diff --git a/examples/http-client/Cargo.toml b/examples/http-client/Cargo.toml index cf08da3d..65b62cc9 100644 --- a/examples/http-client/Cargo.toml +++ b/examples/http-client/Cargo.toml @@ -23,8 +23,8 @@ crate-type = ["lib", "cdylib"] [dependencies] phper = { workspace = true } -reqwest = { version = "0.12.5", features = ["blocking", "cookies"] } -thiserror = "1.0.63" +reqwest = { version = "0.12.12", features = ["blocking", "cookies"] } +thiserror = "2.0.9" [dev-dependencies] phper-test = { workspace = true } diff --git a/examples/http-server/Cargo.toml b/examples/http-server/Cargo.toml index 2e733082..89f2dfa0 100644 --- a/examples/http-server/Cargo.toml +++ b/examples/http-server/Cargo.toml @@ -22,13 +22,13 @@ name = "http_server" crate-type = ["lib", "cdylib"] [dependencies] -hyper = { version = "1.4.1", features = ["http1", "server"] } -axum = "0.7.5" +hyper = { version = "1.5.2", features = ["http1", "server"] } +axum = "0.8.1" phper = { workspace = true } -thiserror = "1.0.63" -tokio = { version = "1.39.2", features = ["full"] } -reqwest = { version = "0.12.5", features = ["blocking"] } +thiserror = "2.0.9" +tokio = { version = "1.42.0", features = ["full"] } +reqwest = { version = "0.12.12", features = ["blocking"] } [dev-dependencies] phper-test = { workspace = true } -reqwest = "0.12.5" +reqwest = "0.12.12" diff --git a/phper-doc/Cargo.toml b/phper-doc/Cargo.toml index 0109c0c6..2e8b0700 100644 --- a/phper-doc/Cargo.toml +++ b/phper-doc/Cargo.toml @@ -23,5 +23,5 @@ license = { workspace = true } phper = { workspace = true } [dev-dependencies] -thiserror = "1.0.63" -reqwest = { version = "0.12.5", features = ["blocking", "cookies"] } +thiserror = "2.0.9" +reqwest = { version = "0.12.12", features = ["blocking", "cookies"] } diff --git a/phper-doc/doc/_03_integrate_with_pecl/index.md b/phper-doc/doc/_03_integrate_with_pecl/index.md index f4053956..3a2e7e00 100644 --- a/phper-doc/doc/_03_integrate_with_pecl/index.md +++ b/phper-doc/doc/_03_integrate_with_pecl/index.md @@ -10,8 +10,7 @@ This chapter will guide you on how to integrate the phper project with `pecl` an ### Adapt to `phpize` -1. At first, imagine you have finished the hello project follow [write your first extension](_02_quick_start::_01_write_your_first_extension), can build the -php extension `.so` file successfully. +1. At first, imagine you have finished the hello project follow [write your first extension](_02_quick_start::_01_write_your_first_extension), can build the php extension `.so` file successfully. 1. And then, create the `config.m4` file using by `phpize` (In theory, `config.w32` is also required for compatibility with Windows, but now phper diff --git a/phper-macros/Cargo.toml b/phper-macros/Cargo.toml index 62ab3a75..c3b45a45 100644 --- a/phper-macros/Cargo.toml +++ b/phper-macros/Cargo.toml @@ -23,9 +23,9 @@ license = { workspace = true } proc-macro = true [dependencies] -quote = "1.0.36" -syn = { version = "2.0.72", features = ["full"] } -proc-macro2 = "1.0.86" +quote = "1.0.38" +syn = { version = "2.0.95", features = ["full"] } +proc-macro2 = "1.0.92" [dev-dependencies] -syn = { version = "2.0.72", features = ["full", "extra-traits"] } +syn = { version = "2.0.95", features = ["full", "extra-traits"] } diff --git a/phper-sys/Cargo.toml b/phper-sys/Cargo.toml index 1dc69779..135c2a02 100644 --- a/phper-sys/Cargo.toml +++ b/phper-sys/Cargo.toml @@ -20,7 +20,6 @@ repository = { workspace = true } license = { workspace = true } [build-dependencies] -bindgen = "0.69.4" -cc = "1.1.7" -home = "=0.5.9" -regex = "1.10.6" +bindgen = "0.71.1" +cc = "1.2.7" +regex = "1.11.1" diff --git a/phper-test/Cargo.toml b/phper-test/Cargo.toml index 97706815..3e805adf 100644 --- a/phper-test/Cargo.toml +++ b/phper-test/Cargo.toml @@ -21,11 +21,11 @@ license = { workspace = true } [dependencies] fastcgi-client = "0.9.0" -libc = "0.2.155" -once_cell = "1.19.0" +libc = "0.2.169" +once_cell = "1.20.2" phper-macros = { workspace = true } -tempfile = "3.11.0" -tokio = { version = "1.39.2", features = ["full"] } +tempfile = "3.15.0" +tokio = { version = "1.42.0", features = ["full"] } [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/phper-test/src/cli.rs b/phper-test/src/cli.rs index d1e40c77..3598d74b 100644 --- a/phper-test/src/cli.rs +++ b/phper-test/src/cli.rs @@ -41,8 +41,7 @@ pub type ScriptCondition<'a> = (&'a dyn AsRef, &'a dyn Fn(Output) -> bool) /// checkers are pass, than the test is pass. /// /// - `exec_path` is the path of the make executable, which will be used to -/// detect the path of -/// extension lib. +/// detect the path of extension lib. /// /// - `scripts` is the slice of the tuple, format is `(path of your php test /// script, checker function or closure)`. @@ -93,6 +92,7 @@ pub fn test_php_scripts_with_condition( /// Check your extension by executing the long term php script such as http /// server, if the all your specified checkers are pass, than the test is pass. +#[allow(clippy::zombie_processes)] pub fn test_long_term_php_script_with_condition( lib_path: impl AsRef, script: impl AsRef, condition: impl FnOnce(&Child) + UnwindSafe, diff --git a/phper-test/src/context.rs b/phper-test/src/context.rs index 8843e155..b3d5104e 100644 --- a/phper-test/src/context.rs +++ b/phper-test/src/context.rs @@ -98,7 +98,7 @@ impl Context { .and_then(|name| { let mut p = p.to_path_buf(); p.push("sbin"); - p.push(&format!( + p.push(format!( "php-fpm{}", if name.starts_with("php") { name.chars().skip(3).collect::() diff --git a/phper/Cargo.toml b/phper/Cargo.toml index 241bded4..4c8cb278 100644 --- a/phper/Cargo.toml +++ b/phper/Cargo.toml @@ -23,13 +23,13 @@ license = { workspace = true } [dependencies] cfg-if = "1.0.0" -derive_more = "0.99.18" -indexmap = "2.3.0" -once_cell = "1.19.0" +derive_more = { version = "1.0.0", features = ["constructor", "from"] } +indexmap = "2.7.0" +once_cell = "1.20.2" phper-alloc = { workspace = true } phper-macros = { workspace = true } phper-sys = { workspace = true } -thiserror = "1.0.63" +thiserror = "2.0.9" [build-dependencies] phper-build = { workspace = true } diff --git a/phper/src/arrays.rs b/phper/src/arrays.rs index adc609e7..fa31c2f7 100644 --- a/phper/src/arrays.rs +++ b/phper/src/arrays.rs @@ -49,6 +49,12 @@ pub enum InsertKey<'a> { ZStr(&'a ZStr), } +impl From<()> for InsertKey<'_> { + fn from(_: ()) -> Self { + Self::NextIndex + } +} + impl<'a> From> for InsertKey<'a> { fn from(k: Key<'a>) -> Self { match k { @@ -468,7 +474,7 @@ struct RawIter<'a> { _p: PhantomData<&'a ()>, } -impl<'a> RawIter<'a> { +impl RawIter<'_> { fn new(arr: *mut zend_array) -> Self { let mut pos: HashPosition = 0; unsafe { diff --git a/phper/src/output.rs b/phper/src/output.rs index 452d633c..49e637de 100644 --- a/phper/src/output.rs +++ b/phper/src/output.rs @@ -33,7 +33,7 @@ pub fn log(level: LogLevel, message: impl Into) { unsafe { php_error_docref1( null(), - "\0".as_ptr().cast(), + c"".as_ptr().cast(), level as i32, message.as_ptr().cast(), ); diff --git a/phper/src/types.rs b/phper/src/types.rs index d04e4ee2..f333e43d 100644 --- a/phper/src/types.rs +++ b/phper/src/types.rs @@ -200,6 +200,12 @@ pub enum Scalar { Bytes(Vec), } +impl From<()> for Scalar { + fn from(_: ()) -> Self { + Self::Null + } +} + impl From<&str> for Scalar { fn from(s: &str) -> Self { Self::String(s.to_owned()) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 688a0416..dcf40aec 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -9,5 +9,5 @@ # See the Mulan PSL v2 for more details. [toolchain] -channel = "1.79" -components = ["clippy", "rustfmt"] +channel = "1.83" +components = ["clippy", "rustfmt", "rust-analyzer"] diff --git a/tests/integration/Cargo.toml b/tests/integration/Cargo.toml index fe65c6df..22668bbb 100644 --- a/tests/integration/Cargo.toml +++ b/tests/integration/Cargo.toml @@ -21,7 +21,7 @@ license = { workspace = true } crate-type = ["lib", "cdylib"] [dependencies] -indexmap = "2.3.0" +indexmap = "2.7.0" phper = { workspace = true } [dev-dependencies]