diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 11:21:45 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 11:21:45 +0900 |
| commit | 548ec1ffb232da4411ae8890080bcfd63300cda0 (patch) | |
| tree | 2860e71a0fe1b72a959f90d15ab543c9a72bae1d /crates/shirabe-seld-signal/src | |
| parent | a8a4b54b90e6433cf4a25a88a4765243f831ebef (diff) | |
| download | php-shirabe-548ec1ffb232da4411ae8890080bcfd63300cda0.tar.gz php-shirabe-548ec1ffb232da4411ae8890080bcfd63300cda0.tar.zst php-shirabe-548ec1ffb232da4411ae8890080bcfd63300cda0.zip | |
refactor(seld-signal): extract seld/signal into the shirabe-seld-signal crate
Move `Seld\Signal` out of shirabe-external-packages and into its own
crate, so the path is `shirabe_seld_signal::SignalHandler` instead of
`shirabe_external_packages::seld::signal::SignalHandler`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-seld-signal/src')
| -rw-r--r-- | crates/shirabe-seld-signal/src/lib.rs | 3 | ||||
| -rw-r--r-- | crates/shirabe-seld-signal/src/signal_handler.rs | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/crates/shirabe-seld-signal/src/lib.rs b/crates/shirabe-seld-signal/src/lib.rs new file mode 100644 index 00000000..16f51510 --- /dev/null +++ b/crates/shirabe-seld-signal/src/lib.rs @@ -0,0 +1,3 @@ +pub mod signal_handler; + +pub use signal_handler::*; diff --git a/crates/shirabe-seld-signal/src/signal_handler.rs b/crates/shirabe-seld-signal/src/signal_handler.rs new file mode 100644 index 00000000..b2f1873e --- /dev/null +++ b/crates/shirabe-seld-signal/src/signal_handler.rs @@ -0,0 +1,25 @@ +//! ref: composer/vendor/seld/signal-handler/src/SignalHandler.php + +#[derive(Debug)] +pub struct SignalHandler; + +// TODO(phase-c): disable signal handler at all for now. +impl SignalHandler { + pub const SIGINT: &'static str = "SIGINT"; + pub const SIGTERM: &'static str = "SIGTERM"; + pub const SIGHUP: &'static str = "SIGHUP"; + + pub fn create(_signals: Vec<String>, _callback: Box<dyn Fn(String, &SignalHandler)>) -> Self { + Self + } + + pub fn unregister(&self) {} + + pub fn exit_with_last_signal(&self) { + std::process::exit(0); + } + + pub fn is_triggered(&self) -> bool { + false + } +} |
