<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.memcache.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'memcache.getserverstatus.php',
    1 => 'Memcache::getServerStatus',
    2 => 'Возвращает статус сервера',
  ),
  'up' => 
  array (
    0 => 'class.memcache.php',
    1 => 'Memcache',
  ),
  'prev' => 
  array (
    0 => 'memcache.getextendedstats.php',
    1 => 'Memcache::getExtendedStats',
  ),
  'next' => 
  array (
    0 => 'memcache.getstats.php',
    1 => 'Memcache::getStats',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/memcache/memcache/getserverstatus.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="memcache.getserverstatus" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcache::getServerStatus</h1>
  <h1 class="refname">memcache_get_server_status</h1>
  <p class="verinfo">(PECL memcache &gt;= 2.1.0)</p><p class="refpurpose"><span class="refname">Memcache::getServerStatus</span> -- <span class="refname">memcache_get_server_status</span> &mdash; <span class="dc-title">Возвращает статус сервера</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcache.getserverstatus-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>Memcache::getServerStatus</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$host</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$port</code><span class="initializer"> = 11211</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <div class="methodsynopsis dc-description"><span class="methodname"><strong>memcache_get_server_status</strong></span>(<span class="methodparam"><span class="type"><a href="class.memcache.php" class="type Memcache">Memcache</a></span> <code class="parameter">$memcache</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$host</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$port</code><span class="initializer"> = 11211</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>


  <p class="simpara">
   Метод <span class="function"><strong>Memcache::getServerStatus()</strong></span> возвращает статус сервера: онлайн или офлайн.
  </p>

  <blockquote class="note"><p><strong class="note">Замечание</strong>: 
   <span class="simpara">
    Функцию добавили в модуль Memcache версии 2.1.0.
   </span>
  </p></blockquote>

 </div>


 <div class="refsect1 parameters" id="refsect1-memcache.getserverstatus-parameters">
  <h3 class="title">Список параметров</h3>
  <dl>
   
    <dt><code class="parameter">host</code></dt>
    <dd>
     <span class="simpara">
      В параметре указывается хост, на котором сервер memcached прослушивает соединения.
     </span>
    </dd>
   
   
    <dt><code class="parameter">port</code></dt>
    <dd>
     <span class="simpara">
      В параметре указывается порт, на котором сервер memcached прослушивает соединения.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcache.getserverstatus-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="simpara">
   Метод возвращает статус сервера: 0 при сбое сервера, иначе ненулевое значение.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-memcache.getserverstatus-examples">
  <h3 class="title">Примеры</h3>
  <div class="example" id="example-1">
   <p><strong>Пример #1 Пример получения статуса сервера методом <span class="function"><strong>Memcache::getServerStatus()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/* Объектно-ориентированный API */<br /></span><span style="color: #0000BB">$memcache </span><span style="color: #007700">= new </span><span style="color: #0000BB">Memcache</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$memcache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addServer</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$memcache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getServerStatus</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Процедурный API */<br /></span><span style="color: #0000BB">$memcache </span><span style="color: #007700">= </span><span style="color: #0000BB">memcache_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">memcache_get_server_status</span><span style="color: #007700">(</span><span style="color: #0000BB">$memcache</span><span style="color: #007700">, </span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">, </span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-memcache.getserverstatus-seealso">
  <h3 class="title">Смотрите также</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="memcache.addserver.php" class="function" rel="rdfs-seeAlso">Memcache::addServer()</a> - Добавляет сервер memcached в пул соединений</span></li>
   <li><span class="function"><a href="memcache.setserverparams.php" class="function" rel="rdfs-seeAlso">Memcache::setServerParams()</a> - Изменяет параметры и статус сервера во время выполнения</span></li>
  </ul>
 </div>


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