aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-01 01:33:38 +0900
committernsfisis <nsfisis@gmail.com>2026-07-01 01:33:40 +0900
commit1de6ba5c6735e42b5f462c0b7489bcf172ccdc08 (patch)
tree3a26a8cfe640d10c0d028f0c5087b89e4c8eb167 /crates/shirabe
parent2b1c6c58a8c9e9afa8ba54214bc0bee48b06142f (diff)
downloadphp-shirabe-1de6ba5c6735e42b5f462c0b7489bcf172ccdc08.tar.gz
php-shirabe-1de6ba5c6735e42b5f462c0b7489bcf172ccdc08.tar.zst
php-shirabe-1de6ba5c6735e42b5f462c0b7489bcf172ccdc08.zip
feat(php-rpc): query real PHP version and binary for --version
Add a minimal shirabe-php-rpc crate that spawns the system PHP as a child process and asks it for runtime information over a Unix domain socket, then use it to fill the `--version` PHP line with the real \PHP_VERSION and \PHP_BINARY instead of fixed placeholder values. See docs/dev/php-rpc.md for the design and scope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
-rw-r--r--crates/shirabe/Cargo.toml1
-rw-r--r--crates/shirabe/src/console/application.rs18
2 files changed, 10 insertions, 9 deletions
diff --git a/crates/shirabe/Cargo.toml b/crates/shirabe/Cargo.toml
index 632b659..7ec9db8 100644
--- a/crates/shirabe/Cargo.toml
+++ b/crates/shirabe/Cargo.toml
@@ -7,6 +7,7 @@ edition.workspace = true
shirabe-class-map-generator.workspace = true
shirabe-external-packages.workspace = true
shirabe-metadata-minifier.workspace = true
+shirabe-php-rpc.workspace = true
shirabe-php-shim.workspace = true
shirabe-semver.workspace = true
shirabe-spdx-licenses.workspace = true
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 077ea0a..a3b4df7 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -93,14 +93,13 @@ use shirabe_external_packages::symfony::console::style::symfony_style::SymfonySt
use shirabe_external_packages::symfony::console::terminal::Terminal;
use shirabe_external_packages::symfony::process::exception::ProcessTimedOutException;
use shirabe_php_shim::{
- LogicException as ShimLogicException, PHP_BINARY, PHP_VERSION, PHP_VERSION_ID, PhpMixed,
- RuntimeException, bin2hex, chdir, date_default_timezone_get, date_default_timezone_set,
- defined, dirname, disk_free_space, extension_loaded, file_exists, file_get_contents,
- file_put_contents, function_exists, getcwd, getmypid, glob, in_array, ini_set, is_array,
- is_dir, is_file, is_string, is_subclass_of, json_decode, memory_get_peak_usage,
- memory_get_usage, microtime, php_uname, posix_getuid, random_bytes, realpath,
- restore_error_handler, round, str_contains, str_replace, strpos, strtoupper, sys_get_temp_dir,
- time, unlink,
+ LogicException as ShimLogicException, PHP_VERSION, PHP_VERSION_ID, PhpMixed, RuntimeException,
+ bin2hex, chdir, date_default_timezone_get, date_default_timezone_set, defined, dirname,
+ disk_free_space, extension_loaded, file_exists, file_get_contents, file_put_contents,
+ function_exists, getcwd, getmypid, glob, in_array, ini_set, is_array, is_dir, is_file,
+ is_string, is_subclass_of, json_decode, memory_get_peak_usage, memory_get_usage, microtime,
+ php_uname, posix_getuid, random_bytes, realpath, restore_error_handler, round, str_contains,
+ str_replace, strpos, strtoupper, sys_get_temp_dir, time, unlink,
};
/// The PHP `Composer\Console\Application` and `Symfony\Component\Console\Application` are
@@ -2492,7 +2491,8 @@ impl ApplicationHandle {
{
io.write_error(&format!(
"<info>PHP</info> version <comment>{}</comment> ({})",
- PHP_VERSION, PHP_BINARY,
+ shirabe_php_rpc::get_php_version(),
+ shirabe_php_rpc::get_php_binary(),
));
io.write_error(
"Run the \"diagnose\" command to get more detailed diagnostics output.",