diff options
Diffstat (limited to 'crates/shirabe/src')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/problem.rs | 4 | ||||
| -rw-r--r-- | crates/shirabe/src/main.rs | 7 | ||||
| -rw-r--r-- | crates/shirabe/src/util/ini_helper.rs | 8 |
3 files changed, 15 insertions, 4 deletions
diff --git a/crates/shirabe/src/dependency_resolver/problem.rs b/crates/shirabe/src/dependency_resolver/problem.rs index 855638cf..5ff949a9 100644 --- a/crates/shirabe/src/dependency_resolver/problem.rs +++ b/crates/shirabe/src/dependency_resolver/problem.rs @@ -459,7 +459,9 @@ impl Problem { Self::constraint_to_text(constraint) ); - let runtime_version = phpversion(&ext); + // Per-extension version info can't be known statically; query the real PHP + // runtime via the RPC bridge, same as platform::runtime::Runtime::get_extension_version. + let runtime_version = shirabe_php_rpc::phpversion(&ext); let effective_version = match runtime_version { None => "0".to_string(), Some(ref v) => v.clone(), diff --git a/crates/shirabe/src/main.rs b/crates/shirabe/src/main.rs index 2ae6d903..6eb8e4cb 100644 --- a/crates/shirabe/src/main.rs +++ b/crates/shirabe/src/main.rs @@ -3,6 +3,13 @@ use shirabe_php_shim::{PHP_ENV, PHP_SERVER}; fn main() { + // TODO(phase-c): PHP: `$xdebug = new XdebugHandler('Composer'); $xdebug->check(); unset($xdebug);` + // (restart the process without Xdebug loaded, for performance) is not ported. Since no + // XdebugHandler is ever constructed, `self::$name` never gets set, so the + // COMPOSER_ORIGINAL_INIS-env-var branch of XdebugHandler::getAllIniFiles() (see + // shirabe-external-packages' xdebug_handler.rs and shirabe/src/util/ini_helper.rs) is + // unreachable in this port, not merely unexercised by current tests. + // Take the $_ENV / $_SERVER snapshots before any putenv() mutates the real environment. // See `docs/dev/env-vars-porting.md` for details. std::sync::LazyLock::force(&PHP_ENV); diff --git a/crates/shirabe/src/util/ini_helper.rs b/crates/shirabe/src/util/ini_helper.rs index 57894113..c36b9189 100644 --- a/crates/shirabe/src/util/ini_helper.rs +++ b/crates/shirabe/src/util/ini_helper.rs @@ -1,13 +1,15 @@ //! ref: composer/src/Composer/Util/IniHelper.php -use shirabe_external_packages::composer::xdebug_handler::XdebugHandler; - pub struct IniHelper; impl IniHelper { /// Returns an array of php.ini locations with at least one entry. pub fn get_all() -> Vec<String> { - XdebugHandler::get_all_ini_files() + // PHP: XdebugHandler::getAllIniFiles(). shirabe_external_packages::XdebugHandler's port + // of that method can't reach the PHP RPC bridge (shirabe-php-rpc already depends on + // shirabe-external-packages, so the reverse dependency would cycle), so query the real + // PHP runtime's loaded/scanned ini files here instead. + shirabe_php_rpc::get_all_ini_files() } /// Describes the location of the loaded php.ini file(s). |
