diff options
Diffstat (limited to 'crates/shirabe-xdebug-handler')
| -rw-r--r-- | crates/shirabe-xdebug-handler/Cargo.toml | 7 | ||||
| -rw-r--r-- | crates/shirabe-xdebug-handler/src/lib.rs | 3 | ||||
| -rw-r--r-- | crates/shirabe-xdebug-handler/src/xdebug_handler.rs | 32 |
3 files changed, 42 insertions, 0 deletions
diff --git a/crates/shirabe-xdebug-handler/Cargo.toml b/crates/shirabe-xdebug-handler/Cargo.toml new file mode 100644 index 00000000..cd8f42eb --- /dev/null +++ b/crates/shirabe-xdebug-handler/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "shirabe-xdebug-handler" +version.workspace = true +edition.workspace = true + +[lints] +workspace = true 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()] + } +} |
