Download the PHP package mshavliuk/mshavliuk-signal-events-bundle without Composer
On this page you can find all versions of the php package mshavliuk/mshavliuk-signal-events-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mshavliuk-signal-events-bundle
MshavliukSignalEventsBundle
About
This bundle provides service, that emits events for every handled UNIX signals into your Symfony application. It relies on PCNTL php-extension, which you can check by running
Expected output:
Installation
Add the mshavliuk/mshavliuk-signal-events-bundle
package to your require
section in the composer.json
file.
Usage
Automatic startup
By default it will handle every possible signals and startup after console.command
event which is basically in every
php bin/console
run.
Configure the bundle in your config.yml
:
Manual
To prevent automatic startup you can specify empty arrays for startup_events
config:
In that case you can manually inject Mshavliuk\MshavliukSignalEventsBundle\Service\SignalHandlerService
and configure
signals to handle:
Handling signal events
You can register any callback function to handle specific event via EventDispatcherInterface::addListener
function.
See the following example:
Also you can create special listener class and bind its public method for process any signals:
services.yaml:
SignalListener.php:
For more information read the official Symfony documentation.
License
See LICENSE.
All versions of mshavliuk-signal-events-bundle with dependencies
ext-pcntl Version *
symfony/yaml Version ^4.0
symfony/process Version ^4.0
symfony/console Version ^4.0
symfony/http-kernel Version ^4.0
symfony/dependency-injection Version ^4.0
symfony/config Version ^4.0