AbstractDaemonApplication
class AbstractDaemonApplication extends AbstractCliApplication implements LoggerAwareInterface (View source)
Class to turn Cli applications into daemons. It requires CLI and PCNTL support built into PHP.
Methods
Execute the daemon.
Returns a property of the object or the default value if the property is not set.
Modifies a property of the object, creating it if it does not already exist.
is utilized for reading data from inaccessible members.
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.
Load an object or array into the application configuration object.
Restart daemon process.
Stop daemon process.
Get application name.
Set application name.
Details
at line line 114
__construct(IOInterface $io = null, Structure $config = null)
Class constructor.
in AbstractApplication at line line 64
void
close(integer|string $message)
Method to close the application.
at line line 376
mixed
execute()
Execute the daemon.
in AbstractApplication at line line 128
mixed
get(string $key, mixed $default = null)
Returns a property of the object or the default value if the property is not set.
in AbstractApplication at line line 140
LoggerInterface
getLogger()
Get the logger.
in AbstractApplication at line line 175
mixed
set(string $key, mixed $value = null)
Modifies a property of the object, creating it if it does not already exist.
in AbstractApplication at line line 193
AbstractApplication
setConfiguration(Structure $config)
Sets the configuration for the application.
in AbstractApplication at line line 209
AbstractApplication
setLogger(LoggerInterface $logger)
Set the logger.
in AbstractCliApplication at line line 124
mixed
__get($name)
is utilized for reading data from inaccessible members.
in AbstractCliApplication at line line 74
AbstractCliApplication
out(string $text = '', boolean $nl = true)
Write a string to standard output.
in AbstractCliApplication at line line 88
string
in()
Get a value from standard input.
in AbstractCliApplication at line line 98
IOInterface
getIO()
Get the IO object.
in AbstractCliApplication at line line 110
AbstractCliApplication
setIO(IOInterface $io)
Set the IO object.
at line line 161
void
signal(integer $signal)
Method to handle POSIX signals.
at line line 235
boolean
isActive()
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.
at line line 281
AbstractDaemonApplication
loadConfiguration(mixed $data)
Load an object or array into the application configuration object.
at line line 426
void
restart()
Restart daemon process.
at line line 441
void
stop()
Stop daemon process.
at line line 941
string
getName()
Get application name.
at line line 955
AbstractDaemonApplication
setName(string $name)
Set application name.