phpninjas / signal
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/phpninjas/signal
Requires
- php: >=5.5
 - ext-pcntl: *
 
Requires (Dev)
- phpunit/phpunit: 4.*
 
This package is not auto-updated.
Last update: 2025-10-26 00:51:27 UTC
README
Requirements
pcntl library is REQUIRED for this to work.
Trapping Signals
// Simple message trap
Signal::trap(Signal::USR2, function()use(){
    echo "caught a signal!";
});
Blocking/Unblocking Signals
// Allows you to effectively ignore POSIX signals from the OS (except for KILL obviously)
Signal::block([Signal::USR2]);
Signal::unblock([Signal::USR2]);