\JDaemon
Backward Compatability Stub for JApplicationDaemon
Synopsis
class JDaemon
extends JApplicationDaemon
{
- // Inherited members from JApplicationDaemon
- protected $signals;
- protected $exiting;
- protected $parentId;
- protected $processId;
- protected $running;
- // Inherited members from JApplicationCli
- protected JRegistry $config;
- protected JApplicationCli $instance;
- // Inherited members from JApplicationBase
- protected JEventDispatcher $dispatcher;
- protected JUser $identity;
- public JInput $input;
- // methods
- public void __construct()
- // Inherited methods from JApplicationDaemon
- public void __construct()
- public static void signal()
- public boolean isActive()
- public JCli loadConfiguration()
- public void execute()
- public void restart()
- public void stop()
- protected boolean changeIdentity()
- protected boolean daemonize()
- protected void detach()
- protected integer fork()
- protected void gc()
- protected boolean setupSignalHandlers()
- protected void shutdown()
- protected boolean writeProcessIdFile()
- protected void postFork()
- protected integer pcntlChildExitStatus()
- protected integer pcntlFork()
- protected boolean pcntlSignal()
- protected integer pcntlWait()
- // Inherited methods from JApplicationCli
- public void __construct()
- public mixed get()
- public static JApplicationCli getInstance()
- public void execute()
- public JApplicationCli loadConfiguration()
- public JApplicationCli out()
- public string in()
- public mixed set()
- protected mixed fetchConfigurationData()
- protected void doExecute()
- // Inherited methods from JApplicationBase
- public void close()
- public mixed getIdentity()
- public JApplicationBase registerEvent()
- public array triggerEvent()
- public JApplicationBase loadDispatcher()
- public JApplicationBase loadIdentity()
Hierarchy
Extends
Members
protected
- $config — JRegistry
- $dispatcher
—
JEventDispatcher
The application dispatcher object. - $exiting — boolean
- $identity
—
JUser
The application identity object. - $instance — JApplicationCli
- $parentId — integer
- $processId — integer
- $running — boolean
- $signals — array
public
- $input
—
JInput
The application input object.
Methods
Inherited from JApplicationDaemon
protected
- changeIdentity() — Method to change the identity of the daemon process and resources.
- daemonize() — Method to put the application into the background.
- detach() — This is truly where the magic happens. This is where we fork the process and kill the parent process, which is essentially what turns the application into a daemon.
- fork() — Method to fork the process.
- gc() — Method to perform basic garbage collection and memory management in the sense of clearing the stat cache. We will probably call this method pretty regularly in our main loop.
- pcntlChildExitStatus() — Method to return the exit code of a terminated child process.
- pcntlFork() — Method to return the exit code of a terminated child process.
- pcntlSignal() — Method to install a signal handler.
- pcntlWait() — Method to wait on or return the status of a forked child.
- postFork() — Method to handle post-fork triggering of the onFork event.
- setupSignalHandlers() — Method to attach the JApplicationDaemon signal handler to the known signals. Applications can override these handlers by using the pcntl_signal() function and attaching a different callback method.
- shutdown() — Method to shut down the daemon and optionally restart it.
- writeProcessIdFile() — Method to write the process id file out to disk.
public
- execute() — Execute the daemon.
- 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.
- loadConfiguration() — Load an object or array into the application configuration object.
- restart() — Restart daemon process.
- signal() — Method to handle POSIX signals.
- stop() — Stop daemon process.
Inherited from JApplicationCli
protected
- doExecute() — Method to run the application routines. Most likely you will want to instantiate a controller and execute it, or perform some sort of task directly.
- fetchConfigurationData() — Method to load a PHP configuration class file based on convention and return the instantiated data object. You will extend this method in child classes to provide configuration data from whatever data source is relevant for your specific application.
public
- execute() — Execute the application.
- get() — Returns a property of the object or the default value if the property is not set.
- getInstance() — Returns a reference to the global JApplicationCli object, only creating it if it doesn't already exist.
- in() — Get a value from standard input.
- loadConfiguration() — Load an object or array into the application configuration object.
- out() — Write a string to standard output.
- set() — Modifies a property of the object, creating it if it does not already exist.
Inherited from JApplicationBase
public
- close() — Method to close the application.
- getIdentity() — Get the application identity.
- loadDispatcher() — Allows the application to load a custom or default dispatcher.
- loadIdentity() — Allows the application to load a custom or default identity.
- registerEvent() — Registers a handler to a particular event group.
- triggerEvent() — Calls all handlers associated with an event group.