diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-24 20:22:58 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-24 20:22:58 +0900 |
| commit | 8c316f2c5e93888f4b3a5b8c18df3373b54fa816 (patch) | |
| tree | 06455cd54b6a41febabab13ba76c9d92406b57fe /crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs | |
| parent | 08a99447445167e2b2eeee9c81fc89d5044bfe6d (diff) | |
| download | php-shirabe-8c316f2c5e93888f4b3a5b8c18df3373b54fa816.tar.gz php-shirabe-8c316f2c5e93888f4b3a5b8c18df3373b54fa816.tar.zst php-shirabe-8c316f2c5e93888f4b3a5b8c18df3373b54fa816.zip | |
fix(dependency-resolver): query real PHP for ext-* version/loaded checks
Two shim gaps made the extension-related branches of solver-problem
messages wrong:
- phpversion($ext) with a non-empty extension can't be known statically
(it's shirabe-php-shim's todo!()); Problem::get_missing_package_reason
now calls shirabe_php_rpc::phpversion, the same RPC bridge
platform::runtime::Runtime::get_extension_version already uses.
- extension_loaded's hardcoded allowlist was missing "pcre", a mandatory
always-compiled-in PHP extension, so ext-pcre was misreported as
"missing from your system" instead of "disabled by your platform
config" whenever a platform override disabled it.
Also fix XdebugHandler::getAllIniFiles() always returning `[""]`
(a php-runtime stub): create_extension_hint()'s early-return guard
(`paths[0] empty && len==1`) fired unconditionally, silently dropping
the entire "To enable extensions..." hint from every solver-problem
message that mentions missing extensions. shirabe-external-packages
can't depend on shirabe-php-rpc (shirabe-php-rpc already depends on
shirabe-external-packages), so IniHelper::get_all() queries a new
get_all_ini_files RPC command directly instead of going through the
stub.
This exposed that XdebugHandler is never constructed with a name
because bin/composer's restart-without-Xdebug bootstrap was never
ported to main.rs, making COMPOSER_ORIGINAL_INIS-driven behavior
unreachable; documented with a TODO(phase-c) and updated
ini_helper_test.rs's ignore reasons (and ignored test_with_no_ini,
which only passed before by coincidence with the old stub's constant
output) to match.
Diffstat (limited to 'crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs b/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs index 01f8eb78..3bbe9014 100644 --- a/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs +++ b/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs @@ -19,10 +19,16 @@ impl XdebugHandler { pub fn get_all_ini_files() -> Vec<String> { // TODO(php-runtime) - // No XdebugHandler is ever constructed (`self::$name` stays null) so the - // COMPOSER_ORIG_INIS env lookup is skipped, and without a PHP runtime - // `php_ini_loaded_file()` is `false` and `php_ini_scanned_files()` is `false`, - // so PHP would return `[(string) false]` = `[""]`. + // No XdebugHandler is ever constructed (`self::$name` stays null), because the + // `new XdebugHandler('Composer'); $xdebug->check();` bootstrap in `bin/composer` is not + // ported (see the TODO(phase-c) at the top of shirabe's main.rs), so the + // COMPOSER_ORIGINAL_INIS env-var branch is unreachable here. + // + // shirabe-external-packages cannot depend on shirabe-php-rpc (the reverse dependency + // would cycle, since shirabe-php-rpc already depends on shirabe-external-packages), so + // callers that need the real PHP runtime's ini files (php_ini_loaded_file() / + // php_ini_scanned_files()) query shirabe_php_rpc directly instead of going through this + // stub; see crate::util::ini_helper::IniHelper::get_all. vec![String::new()] } } |
