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

148 lines
5.8 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>Update the service status</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.win32-set-service-status" class="refentry">
<div class="refnamediv">
<h1 class="refname">win32_set_service_status</h1>
<p class="verinfo">(PECL win32service &gt;=0.1.0)</p><p class="refpurpose"><span class="refname">win32_set_service_status</span> &mdash; <span class="dc-title">Update the service status</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.win32-set-service-status-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>win32_set_service_status</strong></span>
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$status</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$checkpoint</code><span class="initializer"> = 0</span></span>
] ) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
Informs the SCM of the current status of a running service.
This call is only valid for a running service process.
</p>
<div class="caution"><strong class="caution">Caution</strong>
<p class="para">
Since version 0.2.0, this function work only in &quot;cli&quot; SAPI. On other SAPI
this function is disabled.
</p>
</div>
</div>
<div class="refsect1 parameters" id="refsect1-function.win32-set-service-status-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">status</code></dt>
<dd>
<p class="para">
The service status code, one of
<strong><code>WIN32_SERVICE_RUNNING</code></strong>,
<strong><code>WIN32_SERVICE_STOPPED</code></strong>,
<strong><code>WIN32_SERVICE_STOP_PENDING</code></strong>,
<strong><code>WIN32_SERVICE_START_PENDING</code></strong>,
<strong><code>WIN32_SERVICE_CONTINUE_PENDING</code></strong>,
<strong><code>WIN32_SERVICE_PAUSE_PENDING</code></strong>,
<strong><code>WIN32_SERVICE_PAUSED</code></strong>.
</p>
</dd>
<dt>
<code class="parameter">checkpoint</code></dt>
<dd>
<p class="para">
The checkpoint value the service increments periodically to report its
progress during a lengthy start, stop, pause, or continue operation.
For example, the service should increment this value as it completes
each step of its initialization when it is starting up.
</p>
<p class="para">
The <code class="parameter">checkpoint</code> is only valid when the
<code class="parameter">status</code> is one of
<strong><code>WIN32_SERVICE_STOP_PENDING</code></strong>,
<strong><code>WIN32_SERVICE_START_PENDING</code></strong>,
<strong><code>WIN32_SERVICE_CONTINUE_PENDING</code></strong> or
<strong><code>WIN32_SERVICE_PAUSE_PENDING</code></strong>.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.win32-set-service-status-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
成功时返回 <strong><code>TRUE</code></strong>,参数错误时返回 <strong><code>FALSE</code></strong>,或失败时返回一个 <a href="win32service.constants.errors.html" class="link">Win32 错误码</a>
</p>
</div>
<div class="refsect1 errors" id="refsect1-function.win32-set-service-status-errors">
<h3 class="title">错误/异常</h3>
<p class="para">
If SAPI is not <em>&quot;cli&quot;</em>, this function emits an <strong><code>E_ERROR</code></strong> level error.
</p>
</div>
<div class="refsect1 changelog" id="refsect1-function.win32-set-service-status-changelog">
<h3 class="title">更新日志</h3>
<p class="para">
<table class="doctable informaltable">
<thead>
<tr>
<th>版本</th>
<th>说明</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>0.2.0</td>
<td>
This function works only in the <em>&quot;cli&quot;</em> SAPI.
</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.win32-set-service-status-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="win32_start_service_ctrl_dispatcher.html" class="function" rel="rdfs-seeAlso">win32_start_service_ctrl_dispatcher()</a> - Registers the script with the SCM, so that it can act as the service with the given name</span></li>
<li class="member"><span class="function"><a href="win32_get_last_control_message.html" class="function" rel="rdfs-seeAlso">win32_get_last_control_message()</a> - Returns the last control message that was sent to this service</span></li>
<li class="member"><span class="function"><a href="win32_set_service_exit_mode.html" class="function" rel="rdfs-seeAlso">win32_set_service_exit_mode()</a> - Define or return the exit mode for the current running service</span></li>
<li class="member"><span class="function"><a href="win32_set_service_exit_code.html" class="function" rel="rdfs-seeAlso">win32_set_service_exit_code()</a> - Define or return the exit code for the current running service</span></li>
<li class="member"><a href="win32service.constants.servicestatus.html" class="link">Win32Service Service Status Constants</a></li>
</ul>
</p>
</div>
</div></div></div></body></html>