diff --git a/Cargo.lock b/Cargo.lock index 5e293f58..1b5859bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -999,7 +999,6 @@ dependencies = [ "cfg-if", "derive_more", "indexmap", - "once_cell", "phper-alloc", "phper-build", "phper-macros", @@ -1103,7 +1102,6 @@ version = "0.15.0" dependencies = [ "fastcgi-client", "libc", - "once_cell", "phper-macros", "tempfile", "tokio", diff --git a/README.md b/README.md index fafb8611..1238cdfd 100644 --- a/README.md +++ b/README.md @@ -24,27 +24,19 @@ The framework that allows us to write PHP extensions using pure and safe Rust wh ### Tested Support -| **Category** | **Item** | **Status** | -| --------------- | -------- | ---------- | -| **OS** | Linux | ✅ | -| | macOS | ✅ | -| | Windows | ❌ | -| **PHP Version** | 7.0 | ✅ | -| | 7.1 | ✅ | -| | 7.2 | ✅ | -| | 7.3 | ✅ | -| | 7.4 | ✅ | -| | 8.0 | ✅ | -| | 8.1 | ✅ | -| | 8.2 | ✅ | -| | 8.3 | ✅ | -| | 8.4 | ✅ | -| **PHP Mode** | NTS | ✅ | -| | ZTS | ❌ | -| **SAPI** | CLI | ✅ | -| | FPM | ✅ | -| **Debug** | Disable | ✅ | -| | Enable | ❌ | +| **Category** | **Item** | **Status** | +| --------------- | --------- | ---------- | +| **OS** | Linux | ✅ | +| | macOS | ✅ | +| | Windows | ❌ | +| **PHP Version** | 7.0 ~ 7.4 | ✅ | +| | 8.0 ~ 8.4 | ✅ | +| **PHP Mode** | NTS | ✅ | +| | ZTS | ❌ | +| **SAPI** | CLI | ✅ | +| | FPM | ✅ | +| **Debug** | Disable | ✅ | +| | Enable | ❌ | ## Examples @@ -54,6 +46,8 @@ See [examples](https://github.com/phper-framework/phper/tree/master/examples). - [apache/skywalking-php](https://github.com/apache/skywalking-php) - The PHP Agent for Apache SkyWalking, which provides the native tracing abilities for PHP project. +- [phper-framework/jieba-php](https://github.com/phper-framework/jieba-php) - The Jieba Chinese Word Segmentation Implemented in Rust Bound for PHP. + ## License [MulanPSL-2.0](https://github.com/phper-framework/phper/blob/master/LICENSE). diff --git a/phper-test/Cargo.toml b/phper-test/Cargo.toml index 26972980..aa8f26ce 100644 --- a/phper-test/Cargo.toml +++ b/phper-test/Cargo.toml @@ -22,7 +22,6 @@ license = { workspace = true } [dependencies] fastcgi-client = "0.9.0" libc = "0.2.169" -once_cell = "1.20.3" phper-macros = { workspace = true } tempfile = "3.17.1" tokio = { version = "1.43.0", features = ["full"] } diff --git a/phper-test/src/context.rs b/phper-test/src/context.rs index b3d5104e..269183f5 100644 --- a/phper-test/src/context.rs +++ b/phper-test/src/context.rs @@ -9,7 +9,6 @@ // See the Mulan PSL v2 for more details. use crate::utils; -use once_cell::sync::OnceCell; use std::{ env, fs::read_to_string, @@ -17,6 +16,7 @@ use std::{ ops::{Deref, DerefMut}, path::Path, process::Command, + sync::OnceLock, }; use tempfile::NamedTempFile; @@ -28,7 +28,7 @@ pub struct Context { impl Context { pub fn get_global() -> &'static Context { - static CONTEXT: OnceCell = OnceCell::new(); + static CONTEXT: OnceLock = OnceLock::new(); CONTEXT.get_or_init(|| { let mut ini_content = String::new(); diff --git a/phper-test/src/fpm.rs b/phper-test/src/fpm.rs index 94ad0257..8da8ea2d 100644 --- a/phper-test/src/fpm.rs +++ b/phper-test/src/fpm.rs @@ -12,19 +12,18 @@ use crate::{context::Context, utils::spawn_command}; use fastcgi_client::{Client, Params, Request}; use libc::{SIGTERM, atexit, kill, pid_t}; -use once_cell::sync::OnceCell; use std::{ fs, mem::{ManuallyDrop, forget}, path::{Path, PathBuf}, process::Child, - sync::Mutex, + sync::{Mutex, OnceLock}, time::Duration, }; use tempfile::NamedTempFile; use tokio::{io, net::TcpStream, runtime::Handle, task::block_in_place}; -static FPM_HANDLE: OnceCell> = OnceCell::new(); +static FPM_HANDLE: OnceLock> = OnceLock::new(); struct FpmHandle { lib_path: PathBuf, diff --git a/phper/Cargo.toml b/phper/Cargo.toml index acba67a8..57f4b153 100644 --- a/phper/Cargo.toml +++ b/phper/Cargo.toml @@ -25,7 +25,6 @@ license = { workspace = true } cfg-if = "1.0.0" derive_more = { version = "2.0.1", features = ["from", "constructor"] } indexmap = "2.7.1" -once_cell = "1.20.3" phper-alloc = { workspace = true } phper-macros = { workspace = true } phper-sys = { workspace = true }