2017 © Pedro Peláez
 

library signal

Web2All signal handling

image

web2all/signal

Web2All signal handling

  • Friday, December 15, 2017
  • by merijnvdk
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Web2All signal

This package can be used to easily enable signal handling in your commandline tool or daemon., (*1)

What does it do

Catch signals sent to your program and allow you to handle them. By default catch kill -HUP, kill and ctrl-c. It is intended for simple usage so you can gracefully shutdown your program., (*2)

Usage

$sh = new Web2All_Signal_Handler();
$sh->pcntlSignalSetup();
while(1){
  // do stuff
  sleep($time);
  // you must call pcntlSignalDispatch regulary (preferably after each sleep)
  // so all signals get handled. Signals will automatically interrupt the
  // php sleep() command.
  $sh->pcntlSignalDispatch();
  if ($sh->pcntlSignalReceived()) break;
}

License

Web2All framework is open-sourced software licensed under the MIT license (https://opensource.org/licenses/MIT)., (*3)

The Versions

15/12 2017

dev-master

9999999-dev

Web2All signal handling

  Sources   Download

MIT

The Requires

  • php >=5.4

 

shell signal kill web2all

15/12 2017

1.0.1

1.0.1.0

Web2All signal handling

  Sources   Download

MIT

The Requires

  • php >=5.4

 

shell signal kill web2all