<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.zookeeperconfig.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'zookeeperconfig.get.php',
    1 => 'ZookeeperConfig::get',
    2 => 'Gets the last committed configuration of the ZooKeeper cluster as it is known to the server to which the client is connected, synchronously',
  ),
  'up' => 
  array (
    0 => 'class.zookeeperconfig.php',
    1 => 'ZookeeperConfig',
  ),
  'prev' => 
  array (
    0 => 'zookeeperconfig.add.php',
    1 => 'ZookeeperConfig::add',
  ),
  'next' => 
  array (
    0 => 'zookeeperconfig.remove.php',
    1 => 'ZookeeperConfig::remove',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/zookeeper/zookeeperconfig/get.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="zookeeperconfig.get" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZookeeperConfig::get</h1>
  <p class="verinfo">(PECL zookeeper &gt;= 0.6.0, ZooKeeper &gt;= 3.5.0)</p><p class="refpurpose"><span class="refname">ZookeeperConfig::get</span> &mdash; <span class="dc-title">Gets the last committed configuration of the ZooKeeper cluster as it is known to the server to which the client is connected, synchronously</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-zookeeperconfig.get-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>ZookeeperConfig::get</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$watcher_cb</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter reference">&$stat</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-zookeeperconfig.get-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">watcher_cb</code></dt>
    <dd>
     <p class="para">
      If nonzero, a watch will be set at the server to notify the client if the node changes.
     </p>
    </dd>
   
   
    <dt><code class="parameter">stat</code></dt>
    <dd>
     <p class="para">
      If not NULL, will hold the value of stat for the path on return.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-zookeeperconfig.get-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Returns the configuration string on success, and false on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-zookeeperconfig.get-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="para">
   This method emits <span class="classname"><a href="class.zookeeperexception.php" class="classname">ZookeeperException</a></span> and it&#039;s derivatives when parameters count or types are wrong or fail to get configuration.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-zookeeperconfig.get-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="zookeeperconfig.get.example.basic">
   <p><strong>Beispiel #1 <span class="methodname"><strong>ZookeeperConfig::get()</strong></span> example</strong></p>
   <div class="example-contents"><p>
     Get configuration.
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$zk </span><span style="color: #007700">= new </span><span style="color: #0000BB">Zookeeper</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$zk</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost:2181'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$zk</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addAuth</span><span style="color: #007700">(</span><span style="color: #DD0000">'digest'</span><span style="color: #007700">, </span><span style="color: #DD0000">'timandes:timandes'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$zkConfig </span><span style="color: #007700">= </span><span style="color: #0000BB">$zk</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getConfig</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$r </span><span style="color: #007700">= </span><span style="color: #0000BB">$zkConfig</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get</span><span style="color: #007700">();<br />if (</span><span style="color: #0000BB">$r</span><span style="color: #007700">)<br />  echo </span><span style="color: #0000BB">$r</span><span style="color: #007700">;<br />else<br />  echo </span><span style="color: #DD0000">'ERR'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">server.1=localhost:2888:3888:participant;0.0.0.0:2181
version=0xca01e881a2</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-zookeeperconfig.get-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="zookeeperconfig.set.php" class="methodname" rel="rdfs-seeAlso">ZookeeperConfig::set()</a> - Change ZK cluster ensemble membership and roles of ensemble peers</span></li>
   <li><span class="methodname"><a href="zookeeperconfig.add.php" class="methodname" rel="rdfs-seeAlso">ZookeeperConfig::add()</a> - Add servers to the ensemble</span></li>
   <li><span class="methodname"><a href="zookeeperconfig.remove.php" class="methodname" rel="rdfs-seeAlso">ZookeeperConfig::remove()</a> - Remove servers from the ensemble</span></li>
   <li><span class="classname"><a href="class.zookeeperexception.php" class="classname">ZookeeperException</a></span></li>
  </ul>
 </div>


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