phpninjas/signal

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

Installs: 17

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/phpninjas/signal

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

This package is not auto-updated.

Last update: 2025-10-12 00:41:48 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]);