uTools-Manuals/docs/php/proc_get_status.html
2019-04-28 19:00:34 +08:00

152 lines
5.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>获取由 proc_open 函数打开的进程的信息</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.proc-get-status" class="refentry">
<div class="refnamediv">
<h1 class="refname">proc_get_status</h1>
<p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">proc_get_status</span> &mdash; <span class="dc-title">获取由 <span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 函数打开的进程的信息</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.proc-get-status-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>proc_get_status</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$process</code></span>
) : <span class="type">array</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>proc_get_status()</strong></span> 函数可以获取由
<span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 函数打开的进程的信息。
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.proc-get-status-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">process</code></dt>
<dd>
<p class="para">
要检查的由 <span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 打开的进程 <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span>
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.proc-get-status-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
如果调用成功,则返回一个包含了进程信息的 <span class="type"><a href="language.types.array.html" class="type array">array</a></span>,如果发生错误,返回 <strong><code>FALSE</code></strong>
返回的数组包含下列元素:
</p>
<p class="para">
<table class="doctable informaltable">
<thead>
<tr><th>元素</th><th>类型</th><th>描述</th></tr>
</thead>
<tbody class="tbody">
<tr>
<td>command</td>
<td><span class="type"><a href="language.types.string.html" class="type string">string</a></span></td>
<td>
传入 <span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 函数的命令行字符串。
</td>
</tr>
<tr>
<td>pid</td>
<td><span class="type"><a href="language.types.integer.html" class="type int">int</a></span></td>
<td>进程 ID</td>
</tr>
<tr>
<td>running</td>
<td><span class="type"><a href="language.types.boolean.html" class="type bool">bool</a></span></td>
<td>
<strong><code>TRUE</code></strong> 表示进程还在运行中, <strong><code>FALSE</code></strong> 表示进程已经终止
</td>
</tr>
<tr>
<td>signaled</td>
<td><span class="type"><a href="language.types.boolean.html" class="type bool">bool</a></span></td>
<td>
<strong><code>TRUE</code></strong> 表示子进程被未捕获的信号所终止。
在 Windows 平台永远为 <strong><code>FALSE</code></strong>
</td>
</tr>
<tr>
<td>stopped</td>
<td><span class="type"><a href="language.types.boolean.html" class="type bool">bool</a></span></td>
<td>
<strong><code>TRUE</code></strong> 表示子进程被信号停止。
在 Windows 平台永远为 <strong><code>FALSE</code></strong>
</td>
</tr>
<tr>
<td>exitcode</td>
<td><span class="type"><a href="language.types.integer.html" class="type int">int</a></span></td>
<td>
进程的退出码(仅在 <em>running</em><strong><code>FALSE</code></strong> 时有意义)。
仅在第一次调用此函数时会返回实际的值,
后续的调用将返回 <em>-1</em>
</td>
</tr>
<tr>
<td>termsig</td>
<td><span class="type"><a href="language.types.integer.html" class="type int">int</a></span></td>
<td>
导致子进程终止执行的信号值
(仅在 <em>signaled</em><strong><code>TRUE</code></strong> 时有意义)。
</td>
</tr>
<tr>
<td>stopsig</td>
<td><span class="type"><a href="language.types.integer.html" class="type int">int</a></span></td>
<td>
导致子进程停止执行的信号值
(仅在 <em>stopped</em><strong><code>TRUE</code></strong> 时有意义)。
</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.proc-get-status-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="proc_open.html" class="function" rel="rdfs-seeAlso">proc_open()</a> - 执行一个命令,并且打开用来输入/输出的文件指针。</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>