DaemonApplication
class DaemonApplication extends CliApplication
Class to turn CliApplication applications into daemons. It requires CLI and PCNTL support built into PHP.
Methods
Class constructor.
Registers a handler to a particular event group.
Calls all handlers associated with an event group.
Allows the application to load a custom or default dispatcher.
Allows the application to load a custom or default identity.
Returns a reference to the global CliApplication object, only creating it if it doesn't already exist.
Execute the daemon.
Load an object or array into the application configuration object.
Write a string to standard output.
Method to handle POSIX signals.
Check to see if the daemon is active. This does not assume that $this daemon is active, but only if an instance of the application is active as a daemon.
Restart daemon process.
Stop daemon process.
Details
__construct(
Input $input = null,
Registry $config = null,
JEventDispatcher $dispatcher = null)
Class constructor.
BaseApplication
registerEvent(
string $event,
callable $handler)
Registers a handler to a particular event group.
array
triggerEvent(
string $event,
array $args = null)
Calls all handlers associated with an event group.
BaseApplication
loadDispatcher(
JEventDispatcher $dispatcher = null)
Allows the application to load a custom or default dispatcher.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create event dispatchers, if required, based on more specific needs.
BaseApplication
loadIdentity(
JUser $identity = null)
Allows the application to load a custom or default identity.
The logic and options for creating this object are adequately generic for default cases but for many applications it will make sense to override this method and create an identity, if required, based on more specific needs.
static
CliApplication
getInstance(
string $name = null)
Returns a reference to the global CliApplication object, only creating it if it doesn't already exist.
This method must be invoked as: $cli = CliApplication::getInstance();
CliApplication
loadConfiguration(
mixed $data)
Load an object or array into the application configuration object.