aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-php-shim/src')
-rw-r--r--crates/shirabe-php-shim/src/output.rs3
-rw-r--r--crates/shirabe-php-shim/src/process.rs13
-rw-r--r--crates/shirabe-php-shim/src/runtime.rs7
3 files changed, 3 insertions, 20 deletions
diff --git a/crates/shirabe-php-shim/src/output.rs b/crates/shirabe-php-shim/src/output.rs
index 698f3bf4..d4d83200 100644
--- a/crates/shirabe-php-shim/src/output.rs
+++ b/crates/shirabe-php-shim/src/output.rs
@@ -1,6 +1,5 @@
// PHP output buffering captures everything the interpreter would echo to stdout. The shim has no
-// general echo-to-buffer routing, and its only producer in Composer (`phpinfo`) depends on PHP
-// runtime configuration that is itself unmodeled, so a buffer here would silently capture nothing.
+// general echo-to-buffer routing, so a buffer here would silently capture nothing.
pub fn ob_start() -> bool {
todo!()
}
diff --git a/crates/shirabe-php-shim/src/process.rs b/crates/shirabe-php-shim/src/process.rs
index 2b380c60..b082f472 100644
--- a/crates/shirabe-php-shim/src/process.rs
+++ b/crates/shirabe-php-shim/src/process.rs
@@ -380,12 +380,7 @@ pub fn proc_terminate(process: &PhpResource, signal: i64) -> bool {
let Some(child) = state.child.as_ref() else {
return false;
};
- send_signal(child.id() as i32, signal)
-}
-
-/// Shared body of `proc_terminate` and `posix_kill`. Signal 0 is PHP's existence probe and is
-/// forwarded to `kill(2)` as such.
-fn send_signal(pid: i32, signal: i64) -> bool {
+ // Signal 0 is PHP's existence probe and is forwarded to `kill(2)` as such.
let signal = if signal == 0 {
None
} else {
@@ -394,7 +389,7 @@ fn send_signal(pid: i32, signal: i64) -> bool {
Err(_) => return false,
}
};
- nix::sys::signal::kill(nix::unistd::Pid::from_raw(pid), signal).is_ok()
+ nix::sys::signal::kill(nix::unistd::Pid::from_raw(child.id() as i32), signal).is_ok()
}
pub fn getmypid() -> i64 {
@@ -466,10 +461,6 @@ pub fn posix_isatty(stream: PhpResource) -> bool {
}
}
-pub fn posix_kill(pid: i64, signal: i64) -> bool {
- send_signal(pid as i32, signal)
-}
-
/// PHP `get_current_user()`: the name of the owner of the running script file. The Shirabe
/// executable takes the place of the script; PHP returns an empty string when the lookup fails.
pub fn get_current_user() -> String {
diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs
index 86cbfd74..2b5e7155 100644
--- a/crates/shirabe-php-shim/src/runtime.rs
+++ b/crates/shirabe-php-shim/src/runtime.rs
@@ -27,7 +27,6 @@ pub const E_USER_NOTICE: i64 = 1024;
pub const E_DEPRECATED: i64 = 8192;
pub const E_USER_DEPRECATED: i64 = 16384;
-pub const INFO_GENERAL: i64 = 1;
pub const PHP_BINARY: &str = "";
// NOTE: &str matching in const expression does not compile for now.
@@ -366,12 +365,6 @@ pub fn ini_set(_varname: &str, _value: &str) -> Option<String> {
todo!()
}
-pub fn phpinfo(_what: i64) {
- // TODO(php-runtime): phpinfo() dumps the full PHP runtime configuration, which the shim does not
- // model.
- todo!()
-}
-
pub fn sapi_windows_vt100_support(_resource: &crate::PhpResource) -> bool {
// TODO(phase-c): Windows-only SAPI function; not defined on the non-Windows target this build
// models (function_exists reports it absent).