|
| __construct (Cli $input=null, Registry $config=null, Cli\CliOutput $output=null, Cli\CliInput $cliInput=null) |
|
| signal ($signal) |
|
| isActive () |
|
| loadConfiguration ($data) |
|
| execute () |
|
| restart () |
|
| stop () |
|
| __construct (Input\Cli $input=null, Registry $config=null, Cli\CliOutput $output=null, Cli\CliInput $cliInput=null) |
|
| getOutput () |
|
| getCliInput () |
|
| out ($text='', $nl=true) |
|
| in () |
|
| __construct (Input $input=null, Registry $config=null) |
|
| close ($code=0) |
|
| execute () |
|
| get ($key, $default=null) |
|
| getLogger () |
|
| set ($key, $value=null) |
|
| setConfiguration (Registry $config) |
|
| setLogger (LoggerInterface $logger) |
|
Class to turn Cli applications into daemons. It requires CLI and PCNTL support built into PHP.
https://www.php.net/manual/en/features.commandline.php 1.0 deprecated 1064.
◆ __construct()
Class constructor.
- Paramètres
-
Input\Cli | $input | An optional argument to provide dependency injection for the application's input object. If the argument is an Input object that object will become the application's input object, otherwise a default input object is created. |
Registry | $config | An optional argument to provide dependency injection for the application's config object. If the argument is a Registry object that object will become the application's config object, otherwise a default config object is created. |
Cli\CliOutput | $output | An optional argument to provide dependency injection for the application's output object. If the argument is a Cli object that object will become the application's input object, otherwise a default output object is created. |
Cli\CliInput | $cliInput | An optional argument to provide dependency injection for the application's CLI input object. If the argument is a Cli object that object will become the application's input object, otherwise a default input object is created. |
- Depuis
- 1.0
Références AbstractCliApplication\$cliInput, AbstractApplication\$config, AbstractApplication\$input, AbstractCliApplication\$output, AbstractApplication\getLogger(), et null.
◆ changeIdentity()
◆ daemonize()
◆ detach()
◆ execute()
◆ fork()
◆ 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.
- Renvoie
- void
- Depuis
- 1.0
Référencé par AbstractDaemonApplication\execute().
◆ isActive()
◆ loadConfiguration()
loadConfiguration |
( |
|
$data | ) |
|
Load an object or array into the application configuration object.
- Paramètres
-
mixed | $data | Either an array or object to be loaded into the configuration object. |
- Renvoie
- AbstractDaemonApplication Instance of $this to allow chaining.
- Depuis
- 1.0
Références $name, $options, $tmp, et null.
◆ pcntlChildExitStatus()
pcntlChildExitStatus |
( |
|
$status | ) |
|
|
protected |
Method to return the exit code of a terminated child process.
- Paramètres
-
integer | $status | The status parameter is the status parameter supplied to a successful call to pcntl_waitpid(). |
- Renvoie
- integer The child process exit code.
- Voir également
- pcntl_wexitstatus()
- Depuis
- 1.0
Référencé par AbstractDaemonApplication\signal().
◆ pcntlFork()
Method to return the exit code of a terminated child process.
- Renvoie
- integer On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context, no child process will be created, and a PHP error is raised.
- Voir également
- pcntl_fork()
- Depuis
- 1.0
Référencé par AbstractDaemonApplication\fork().
◆ pcntlSignal()
pcntlSignal |
( |
|
$signal, |
|
|
|
$handler, |
|
|
|
$restart = true |
|
) |
| |
|
protected |
Method to install a signal handler.
- Paramètres
-
integer | $signal | The signal number. |
callable | $handler | The signal handler which may be the name of a user created function, or method, or either of the two global constants SIG_IGN or SIG_DFL. |
boolean | $restart | Specifies whether system call restarting should be used when this signal arrives. |
- Renvoie
- boolean True on success.
- Voir également
- pcntl_signal()
- Depuis
- 1.0
Référencé par AbstractDaemonApplication\setupSignalHandlers().
◆ pcntlWait()
pcntlWait |
( |
& |
$status, |
|
|
|
$options = 0 |
|
) |
| |
|
protected |
Method to wait on or return the status of a forked child.
- Paramètres
-
integer | $status | Status information. |
integer | $options | If wait3 is available on your system (mostly BSD-style systems), you can provide the optional options parameter. |
- Renvoie
- integer The process ID of the child which exited, -1 on error or zero if WNOHANG was provided as an option (on wait3-available systems) and no child was available.
- Voir également
- pcntl_wait()
- Depuis
- 1.0
Références $options.
Référencé par AbstractDaemonApplication\signal().
◆ postFork()
◆ restart()
◆ setupSignalHandlers()
◆ shutdown()
shutdown |
( |
|
$restart = false | ) |
|
|
protected |
◆ signal()
◆ stop()
◆ writeProcessIdFile()
◆ $exiting
◆ $parentId
◆ $processId
◆ $running
◆ $signals
La documentation de cette classe a été générée à partir du fichier suivant :