aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-11 20:14:53 +0900
committernsfisis <nsfisis@gmail.com>2026-06-11 20:14:53 +0900
commit8b7abe99d8c351d6f0e83aca9e12bbb8c3ea8182 (patch)
tree80678d8c3babf71d8bb8265dac9016bb58c9eba1 /crates/shirabe/src/util
parent410858be0520a519531034fcd6c9331a30bc91d2 (diff)
downloadphp-shirabe-8b7abe99d8c351d6f0e83aca9e12bbb8c3ea8182.tar.gz
php-shirabe-8b7abe99d8c351d6f0e83aca9e12bbb8c3ea8182.tar.zst
php-shirabe-8b7abe99d8c351d6f0e83aca9e12bbb8c3ea8182.zip
refactor(argv): use std::env::args instead of server_argv shim
The server_argv() shim merely wrapped command-line arguments, so call std::env::args() directly at each use site and drop the unused shim.
Diffstat (limited to 'crates/shirabe/src/util')
-rw-r--r--crates/shirabe/src/util/platform.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/shirabe/src/util/platform.rs b/crates/shirabe/src/util/platform.rs
index 08f5007..ecf2338 100644
--- a/crates/shirabe/src/util/platform.rs
+++ b/crates/shirabe/src/util/platform.rs
@@ -8,8 +8,8 @@ use shirabe_php_shim::{
PhpMixed, RuntimeException, defined, env_contains_key, env_get, env_set, env_unset,
file_exists, file_get_contents, fopen, fstat, function_exists, getcwd, getenv, in_array,
ini_get, is_array, is_readable, mb_strlen, php_os_family, posix_geteuid, posix_getpwuid,
- posix_getuid, posix_isatty, putenv, realpath, server_argv, server_contains_key, server_get,
- server_set, server_unset, stream_isatty, stripos, strlen, strtoupper, substr, usleep,
+ posix_getuid, posix_isatty, putenv, realpath, server_contains_key, server_get, server_set,
+ server_unset, stream_isatty, stripos, strlen, strtoupper, substr, usleep,
};
use crate::util::ProcessExecutor;
@@ -349,11 +349,9 @@ impl Platform {
false
}
- /// @return bool Whether the current command is for bash completion
+ /// Whether the current command is for bash completion
pub fn is_input_completion_process() -> bool {
- // PHP: $_SERVER['argv'][1] ?? null
- let argv = server_argv();
- argv.get(1).map(|s| s.as_str()) == Some("_complete")
+ std::env::args().nth(1).as_deref() == Some("_complete")
}
pub fn workaround_filesystem_issues() {