You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param resource $process The proc_open resource that will
51
-
* be evaluated.
52
-
* @return array{command: string, pid: int, running: bool, signaled: bool, stopped: bool, exitcode: int, termsig: int, stopsig: int} An array of collected information on success. The returned array contains the following elements:
53
-
*
54
-
*
55
-
*
56
-
*
57
-
* elementtypedescription
58
-
*
59
-
*
60
-
*
61
-
* command
62
-
* string
63
-
*
64
-
* The command string that was passed to proc_open.
65
-
*
66
-
*
67
-
*
68
-
* pid
69
-
* int
70
-
* process id
71
-
*
72
-
*
73
-
* running
74
-
* bool
75
-
*
76
-
* TRUE if the process is still running, FALSE if it has
77
-
* terminated.
78
-
*
79
-
*
80
-
*
81
-
* signaled
82
-
* bool
83
-
*
84
-
* TRUE if the child process has been terminated by
85
-
* an uncaught signal. Always set to FALSE on Windows.
86
-
*
87
-
*
88
-
*
89
-
* stopped
90
-
* bool
91
-
*
92
-
* TRUE if the child process has been stopped by a
93
-
* signal. Always set to FALSE on Windows.
94
-
*
95
-
*
96
-
*
97
-
* exitcode
98
-
* int
99
-
*
100
-
* The exit code returned by the process (which is only
101
-
* meaningful if running is FALSE).
102
-
* Only first call of this function return real value, next calls return
103
-
* -1.
104
-
*
105
-
*
106
-
*
107
-
* termsig
108
-
* int
109
-
*
110
-
* The number of the signal that caused the child process to terminate
111
-
* its execution (only meaningful if signaled is TRUE).
112
-
*
113
-
*
114
-
*
115
-
* stopsig
116
-
* int
117
-
*
118
-
* The number of the signal that caused the child process to stop its
119
-
* execution (only meaningful if stopped is TRUE).
120
-
*
121
-
*
122
-
*
123
-
*
124
-
*
125
-
* @throws ExecException
126
-
*
127
-
*/
128
-
functionproc_get_status($process): array
129
-
{
130
-
error_clear_last();
131
-
$result = \proc_get_status($process);
132
-
if ($result === false) {
133
-
throw ExecException::createFromPhpError();
134
-
}
135
-
return$result;
136
-
}
137
-
138
-
139
46
/**
140
47
* proc_nice changes the priority of the current
141
48
* process by the amount specified in priority. A
@@ -169,16 +76,16 @@ function proc_nice(int $priority): void
169
76
/**
170
77
* This function is identical to the backtick operator.
171
78
*
172
-
* @param string $cmd The command that will be executed.
79
+
* @param string $command The command that will be executed.
173
80
* @return string A string containing the output from the executed command, FALSE if the pipe
174
81
* cannot be established or NULL if an error occurs or the command produces no output.
0 commit comments