diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 11:24:48 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 11:24:48 +0900 |
| commit | 596482de82ff32705e85f18c1c9ae784e6cd2c6f (patch) | |
| tree | 6a970fa30f7770d702d3f6c53232c123d0478d16 /crates/shirabe-xdebug-handler/src | |
| parent | 738a258496318edb6e264b13b8a6d0dc313795d3 (diff) | |
| download | php-shirabe-596482de82ff32705e85f18c1c9ae784e6cd2c6f.tar.gz php-shirabe-596482de82ff32705e85f18c1c9ae784e6cd2c6f.tar.zst php-shirabe-596482de82ff32705e85f18c1c9ae784e6cd2c6f.zip | |
refactor(xdebug-handler): extract composer/xdebug_handler into the shirabe-xdebug-handler crate
Move `Composer\XdebugHandler` out of shirabe-external-packages and into
its own crate, so the path is `shirabe_xdebug_handler::XdebugHandler`
instead of
`shirabe_external_packages::composer::xdebug_handler::XdebugHandler`.
Standing alone, the stub no longer sits in a crate that shirabe-php-rpc
depends on, so drop the dependency-cycle rationale from the comments that
explain why callers reach for shirabe_php_rpc directly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-xdebug-handler/src')
| -rw-r--r-- | crates/shirabe-xdebug-handler/src/lib.rs | 3 | ||||
| -rw-r--r-- | crates/shirabe-xdebug-handler/src/xdebug_handler.rs | 32 |
2 files changed, 35 insertions, 0 deletions
diff --git a/crates/shirabe-xdebug-handler/src/lib.rs b/crates/shirabe-xdebug-handler/src/lib.rs new file mode 100644 index 00000000..c95f237d --- /dev/null +++ b/crates/shirabe-xdebug-handler/src/lib.rs @@ -0,0 +1,3 @@ +pub mod xdebug_handler; + +pub use xdebug_handler::*; diff --git a/crates/shirabe-xdebug-handler/src/xdebug_handler.rs b/crates/shirabe-xdebug-handler/src/xdebug_handler.rs new file mode 100644 index 00000000..6ccedc6a --- /dev/null +++ b/crates/shirabe-xdebug-handler/src/xdebug_handler.rs @@ -0,0 +1,32 @@ +//! ref: composer/vendor/composer/xdebug-handler/src/XdebugHandler.php + +#[derive(Debug)] +pub struct XdebugHandler; + +impl XdebugHandler { + pub fn is_xdebug_active() -> bool { + // TODO(php-runtime) + false + } + + pub fn get_skipped_version() -> Option<String> { + // TODO(php-runtime) + // The restart-to-disable-xdebug mechanism is not ported (`is_xdebug_active` is + // hardcoded `false`), so a restart never happens and `self::$skipped` stays at + // its PHP default of `""`. + Some(String::new()) + } + + pub fn get_all_ini_files() -> Vec<String> { + // TODO(php-runtime) + // 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. + // + // 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 IniHelper::get_all in the shirabe crate. + vec![String::new()] + } +} |
