phpninjas/signal

There is no license information available for the latest version (v0.1.0) of this package.

v0.1.0 2016-07-25 13:12 UTC

This package is not auto-updated.

Last update: 2024-12-21 20:57:44 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]);