<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.win32service.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.win32-set-service-status.php',
    1 => 'win32_set_service_status',
    2 => 'Actualiza el estado de un servicio',
  ),
  'up' => 
  array (
    0 => 'ref.win32service.php',
    1 => 'Funciones win32service',
  ),
  'prev' => 
  array (
    0 => 'function.win32-set-service-pause-resume-state.php',
    1 => 'win32_set_service_pause_resume_state',
  ),
  'next' => 
  array (
    0 => 'function.win32-start-service.php',
    1 => 'win32_start_service',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/win32service/functions/win32-set-service-status.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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">Actualiza el estado de un servicio</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.win32-set-service-status-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>win32_set_service_status</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$status</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$checkpoint</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Informa al SCM del estado actual de un servicio en ejecución. Esta llamada
   solo es válida para un proceso de servicio en ejecución.
  </p>

  <div class="caution"><strong class="caution">Precaución</strong>
   <p class="para">
    Desde la versión 0.2.0, esta función solo funciona en línea de
    comandos (&quot;cli&quot; SAPI). Está deshabilitada en otros casos.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.win32-set-service-status-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">status</code></dt>
     <dd>
      <p class="para">
       El código de estado del servicio, uno de
       <strong><code><a href="win32service.constants.php#constant.win32-service-running">WIN32_SERVICE_RUNNING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-stopped">WIN32_SERVICE_STOPPED</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-stop-pending">WIN32_SERVICE_STOP_PENDING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-start-pending">WIN32_SERVICE_START_PENDING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-continue-pending">WIN32_SERVICE_CONTINUE_PENDING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-pause-pending">WIN32_SERVICE_PAUSE_PENDING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-paused">WIN32_SERVICE_PAUSED</a></code></strong>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">checkpoint</code></dt>
     <dd>
      <p class="para">
       Este valor será incrementado periódicamente por el servicio
       para reportar su progreso durante las operaciones de inicio, detención,
       pausa o reanudación. Por ejemplo, el servicio incrementará este valor
       cuando haya completado cada paso de su inicialización durante el inicio.
      </p>
      <p class="para">
       <code class="parameter">checkpoint</code> solo es válido cuando
       <code class="parameter">status</code> es una de las siguientes constantes:
       <strong><code><a href="win32service.constants.php#constant.win32-service-stop-pending">WIN32_SERVICE_STOP_PENDING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-start-pending">WIN32_SERVICE_START_PENDING</a></code></strong>,
       <strong><code><a href="win32service.constants.php#constant.win32-service-continue-pending">WIN32_SERVICE_CONTINUE_PENDING</a></code></strong> o
       <strong><code><a href="win32service.constants.php#constant.win32-service-pause-pending">WIN32_SERVICE_PAUSE_PENDING</a></code></strong>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.win32-set-service-status-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
    No se retorna ningún valor.
  </p>
  <p class="para">
    Antes de la versión 1.0.0, retornaba <strong><code><a href="win32service.constants.php#constant.win32-no-error">WIN32_NO_ERROR</a></code></strong> en caso de éxito, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si hay un problema con los parámetros o un <a href="win32service.constants.php#win32service.constants.errors" class="link">Código de Error Win32</a> en caso de fallo.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.win32-set-service-status-errors">
  <h3 class="title">Errores/Excepciones</h3>
    <p class="para">
   Antes de la versión 1.0.0, si esta función se utiliza fuera del SAPI <code class="literal">&quot;cli&quot;</code>, se emitirá
   un error <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong>.
  </p>
  <p class="para">
   A partir de la versión 1.0.0, lanzará una
   <span class="classname"><a href="class.win32serviceexception.php" class="classname">Win32ServiceException</a></span> si el SAPI no es
   <code class="literal">&quot;cli&quot;</code>
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.win32-set-service-status-changelog">
  <h3 class="title">Historial de cambios</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Versión</th>
       <th>Descripción</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        Lanzará una <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> si un argumento es inválido,
        anteriormente <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> era retornado.
       </td>
      </tr>

      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        Lanzará una <span class="classname"><a href="class.win32serviceexception.php" class="classname">Win32ServiceException</a></span> en caso de error,
        anteriormente un
        <a href="win32service.constants.php#win32service.constants.errors" class="link">Código de error Win32</a>
        era retornado.
       </td>
      </tr>

      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        El tipo de retorno es ahora <span class="type"><span class="type"><a href="language.types.void.php" class="type void">void</a></span></span>, anteriormente era <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span>.
       </td>
      </tr>

      <tr>
       <td>PECL win32service 0.2.0</td>
       <td>
        Esta función solo funciona en el SAPI <code class="literal">&quot;cli&quot;</code>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.win32-set-service-status-seealso">
  <h3 class="title">Ver también</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.win32-start-service-ctrl-dispatcher.php" class="function" rel="rdfs-seeAlso">win32_start_service_ctrl_dispatcher()</a> - Registra un script con SCM, por lo que puede ser interpretado como un servicio con el nombre dado</span></li>
    <li><span class="function"><a href="function.win32-get-last-control-message.php" class="function" rel="rdfs-seeAlso">win32_get_last_control_message()</a> - Devuelve el &uacute;ltimo mensaje de control que ha sido enviado a este servicio</span></li>
    <li><span class="function"><a href="function.win32-set-service-exit-mode.php" class="function" rel="rdfs-seeAlso">win32_set_service_exit_mode()</a> - Define o devuelve el modo de salida para el servicio en ejecuci&oacute;n</span></li>
    <li><span class="function"><a href="function.win32-set-service-exit-code.php" class="function" rel="rdfs-seeAlso">win32_set_service_exit_code()</a> - Define o devuelve el c&oacute;digo de salida para el servicio en ejecuci&oacute;n</span></li>
    <li>Las <a href="win32service.constants.php#win32service.constants.servicestatus" class="link">constantes de estado de los servicios Win32Service</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>