<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.exec.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.proc-get-status.php',
    1 => 'proc_get_status',
    2 => 'Получает информацию о процессе, который открыли функцией proc_open',
  ),
  'up' => 
  array (
    0 => 'ref.exec.php',
    1 => 'Функции запуска программ',
  ),
  'prev' => 
  array (
    0 => 'function.proc-close.php',
    1 => 'proc_close',
  ),
  'next' => 
  array (
    0 => 'function.proc-nice.php',
    1 => 'proc_nice',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/exec/functions/proc-get-status.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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, PHP 8)</p><p class="refpurpose"><span class="refname">proc_get_status</span> &mdash; <span class="dc-title">
   Получает информацию о процессе, который открыли функцией <span class="function"><a href="function.proc-open.php" 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"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$process</code></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Функция <span class="function"><strong>proc_get_status()</strong></span> получает данные
   о процессе, который открыли через функцию <span class="function"><a href="function.proc-open.php" 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="type"><a href="language.types.resource.php" class="type resource">resource</a></span>, который открыли функцией <span class="function"><a href="function.proc-open.php" class="function">proc_open()</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.php" class="type array">array</a></span>) с полученной информацией.
   Получаемый массив содержит следующие элементы:
  </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.php" class="type string">string</a></span></td>
      <td>
       Строка с командой, которую передали в функцию <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span>.
      </td>
     </tr>

     <tr>
      <td>pid</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>идентификатор процесса</td>
     </tr>

     <tr>
      <td>running</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       Значение элемента равняется <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, если процесс всё ещё запущен, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если процесс
       завершился.
      </td>
     </tr>

     <tr>
      <td>signaled</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       Значение элемента равняется <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, если дочерний процесс завершился неперехваченным
       сигналом. В Windows независимо от условия завершения дочернего процесса значение элемента равняется <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
      </td>
     </tr>

     <tr>
      <td>stopped</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       Значение элемента равняется <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, если дочерний процесс остановился
       сигналом. В Windows независимо от условия остановки дочернего процесса значение элемента равняется <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
      </td>
     </tr>

     <tr>
      <td>exitcode</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       Код завершения, который возвращается процессом и который несёт смысл, только
       если значение элемента <code class="literal">running</code> равно <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
       До PHP 8.3.0 только первый вызов функции возвращал реальное
       значение, очередные вызовы возвращали значение <code class="literal">-1</code>.
      </td>
     </tr>

     <tr>
      <td>cached</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       С PHP 8.3.0 значение элемента равно <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, когда код завершения закешировался.
       Кеширование гарантирует, что код завершения не потеряется
       при очередных вызовах к API-интерфейсу процесса.
      </td>
     </tr>

     <tr>
      <td>termsig</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       Номер сигнала, который заставил дочерний процесс завершить
       выполнение и который несёт смысл, только если значение элемента <code class="literal">signaled</code> равно <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
      </td>
     </tr>

     <tr>
      <td>stopsig</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       Номер сигнала, который заставил дочерний процесс остановить
       выполнение и который несёт смысле, только если значение элемента <code class="literal">stopped</code> равно <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.proc-get-status-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       В массив возврата добавили запись <code class="literal">&quot;cached&quot;</code>.
       До PHP 8.3.0 только первый вызов возвращал реальной код завершения.
       Запись <code class="literal">&quot;cached&quot;</code> указывает на то, что код завершения
       закешировался.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>



 <div class="refsect1 seealso" id="refsect1-function.proc-get-status-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.proc-open.php" class="function" rel="rdfs-seeAlso">proc_open()</a> - Выполняет команду и открывает указатель на файл для ввода или вывода</span></li>
   </ul>
  </p>
 </div>

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