2017 © Pedro Peláez
 

library php-signal-handler

A new and taste way to handle signal from your operational system into you PHP scripts.

image

stavarengo/php-signal-handler

A new and taste way to handle signal from your operational system into you PHP scripts.

  • Friday, July 27, 2018
  • by Stavarengo
  • Repository
  • 0 Watchers
  • 0 Stars
  • 439 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 19 % Grown

The README.md

php-signal-handler

A new and taste way to handle signal from your operational system. If you need to detect when some other process ask your script to stop, this is the library you are looking for., (*1)

Internally We use pcntl-signal PHP function, so, if you wanna to create your own code to detect this signals, read the docs of this function is a good start., (*2)

Installing

Execute composer require stavarengo/php-signal-handler, (*3)

How to use it

We use the observer patner to notify listeners when the signal it wants to listen arrives., (*4)

So, first you need to implement the interface \Sta\PhpSignalHandler\Listener., (*5)

After that, just call \Sta\PhpSignalHandler\SignalHandler::attach(array(SIGTERM), $listener), where: 1. SIGTERM is one of the constants about signals that PHP offers to us (see here). 2. You will only notified about the signals you passed as the first parameter, in the example above, only the signal SIGTERM. 2. $listener is an instance of a class that implements the interface \Sta\PhpSignalHandler\Listener., (*6)

Thats all! When your script receive a signal that you are interested, the listener will be notified., (*7)

The Versions

27/07 2018

dev-master

9999999-dev

A new and taste way to handle signal from your operational system into you PHP scripts.

  Sources   Download

MIT

The Requires

 

by Avatar Stavarengo

26/06 2018

v0.0.4

0.0.4.0

A new and taste way to handle signal from your operational system into you PHP scripts.

  Sources   Download

MIT

The Requires

 

by Avatar Stavarengo

25/06 2018

v0.0.3

0.0.3.0

A new and taste way to handle signal from your operational system into you PHP scripts.

  Sources   Download

MIT

The Requires

 

by Avatar Stavarengo

04/04 2017

v0.0.2

0.0.2.0

A new and taste way to handle signal from your operational system into you PHP scripts.

  Sources   Download

MIT

The Requires

 

by Avatar Stavarengo

04/04 2017

v0.0.1

0.0.1.0

A new and taste way to handle signal from your operational system into you PHP scripts.

  Sources   Download

MIT

The Requires

 

by Avatar Stavarengo

28/11 2016

v0.0.0

0.0.0.0

A new and taste way to handle signal from your operational system into you PHP scripts.

  Sources   Download

MIT

The Requires

  • php >=5.0

 

by Avatar Stavarengo