SignalHandler
in package
Table of Contents
Constants
- DEFAULT_NAMESPACE = '__default__'
Properties
- $_instance : mixed
- $signals : mixed
Methods
- getInstance() : SignalHandler
- Returns the singleton.
- register() : SignalHandler
- Registers as callback for some signals.
- signalHandler() : mixed
- Signal handler.
- unregisterAll() : mixed
- Unregisters all handlers.
- unregisterNamespace() : mixed
- Unregisters callbacks given a namespace, optionally a signal.
- unregisterSignal() : mixed
- Unregisters callbacks given a signal.
- __construct() : mixed
- cleanupHandle() : mixed
- registerSignal() : mixed
Constants
DEFAULT_NAMESPACE
public
mixed
DEFAULT_NAMESPACE
= '__default__'
Properties
$_instance
private
static mixed
$_instance
$signals
private
mixed
$signals
= array()
Methods
getInstance()
Returns the singleton.
public
static getInstance() : SignalHandler
APIYes
Return values
SignalHandlerregister()
Registers as callback for some signals.
public
register(int|array<string|int, mixed> $signals, callable $callback[, string $namespace = self::DEFAULT_NAMESPACE ]) : SignalHandler
APIYes
Parameters
- $signals : int|array<string|int, mixed>
-
A signal or an array of signals.
- $callback : callable
-
A callback to execute on signal.
- $namespace : string = self::DEFAULT_NAMESPACE
-
A namespace where to store the callback.
Return values
SignalHandlersignalHandler()
Signal handler.
public
signalHandler(int $signal) : mixed
Parameters
- $signal : int
unregisterAll()
Unregisters all handlers.
public
unregisterAll() : mixed
APIYes
unregisterNamespace()
Unregisters callbacks given a namespace, optionally a signal.
public
unregisterNamespace(string $namespace[, int $signal = null ]) : mixed
APIYes
Parameters
- $namespace : string
- $signal : int = null
unregisterSignal()
Unregisters callbacks given a signal.
public
unregisterSignal(int $signal) : mixed
APIYes
Parameters
- $signal : int
__construct()
private
__construct() : mixed
cleanupHandle()
private
cleanupHandle(mixed $signal) : mixed
Parameters
- $signal : mixed
registerSignal()
private
registerSignal(mixed $signal, mixed $callback, mixed $namespace) : mixed
Parameters
- $signal : mixed
- $callback : mixed
- $namespace : mixed