<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.win32-set-service-pause-resume-state.php',
    1 => 'win32_set_service_pause_resume_state',
    2 => 'Define or return the pause/resume capability for the current running service',
  ),
  'up' => 
  array (
    0 => 'ref.win32service.php',
    1 => 'win32service Functions',
  ),
  'prev' => 
  array (
    0 => 'function.win32-set-service-exit-mode.php',
    1 => 'win32_set_service_exit_mode',
  ),
  'next' => 
  array (
    0 => 'function.win32-set-service-status.php',
    1 => 'win32_set_service_status',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/win32service/functions/win32-set-service-pause-resume-state.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-pause-resume-state" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">win32_set_service_pause_resume_state</h1>
  <p class="verinfo">(PECL win32service &gt;=1.1.0)</p><p class="refpurpose"><span class="refname">win32_set_service_pause_resume_state</span> &mdash; <span class="dc-title">Define or return the pause/resume capability for the current running service</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.win32-set-service-pause-resume-state-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>win32_set_service_pause_resume_state</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$state</code><span class="initializer"> = true</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   If <code class="parameter">state</code> parameter is provided, the pause/resume capability
is changed.
  </p>

  <div class="caution"><strong class="caution">Caution</strong>
   <p class="para">
    This function work only in &quot;cli&quot; SAPI and in the Windows service running context. On other SAPI
    this function is disabled.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.win32-set-service-pause-resume-state-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">state</code></dt>
    <dd>
     <p class="para">
      <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> for enable the service pause/resume capability. <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> for disable the service pause/resume capability.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.win32-set-service-pause-resume-state-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Return the current or old pause/resume capability state.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.win32-set-service-pause-resume-state-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Prior to version 1.0.0, if the SAPI is not <code class="literal">&quot;cli&quot;</code>, this function emits an
   <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong> level error.
  </p>

   <p class="para">
    As of version 1.0.0, will throw a
    <span class="classname"><a href="class.win32serviceexception.php" class="classname">Win32ServiceException</a></span> if SAPI is not
    <code class="literal">&quot;cli&quot;</code>
   </p>
 </div>



 <div class="refsect1 changelog" id="refsect1-function.win32-set-service-pause-resume-state-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        Throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> on invalid data in parameters,
        previously <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> was returned.
       </td>
      </tr>

      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        Throws a <span class="classname"><a href="class.win32serviceexception.php" class="classname">Win32ServiceException</a></span> on error,
        previously a
        <a href="win32service.constants.php#win32service.constants.errors" class="link">Win32 Error Code</a>
        was returned.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.win32-set-service-pause-resume-state-seealso">
  <h3 class="title">See Also</h3>
  <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> - Registers the script with the SCM, so that it can act as the service with the given name</span></li>
    <li><span class="function"><a href="function.win32-set-service-status.php" class="function" rel="rdfs-seeAlso">win32_set_service_status()</a> - Update the service status</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 or return the exit code for the current running service</span></li>
  </ul>
 </div>


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