<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mongodb-driver-server.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'mongodb-driver-server.getinfo.php',
    1 => 'MongoDB\\Driver\\Server::getInfo',
    2 => 'Retourne un tableau d\'informations d&eacute;crivant ce serveur',
  ),
  'up' => 
  array (
    0 => 'class.mongodb-driver-server.php',
    1 => 'MongoDB\\Driver\\Server',
  ),
  'prev' => 
  array (
    0 => 'mongodb-driver-server.gethost.php',
    1 => 'MongoDB\\Driver\\Server::getHost',
  ),
  'next' => 
  array (
    0 => 'mongodb-driver-server.getlatency.php',
    1 => 'MongoDB\\Driver\\Server::getLatency',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mongodb/mongodb/driver/server/getinfo.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mongodb-driver-server.getinfo" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\Driver\Server::getInfo</h1>
  <p class="verinfo">(mongodb &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">MongoDB\Driver\Server::getInfo</span> &mdash; <span class="dc-title">Retourne un tableau d&#039;informations décrivant ce serveur</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-driver-server.getinfo-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\Driver\Server::getInfo</strong></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Retourne un tableau d&#039;informations décrivant le serveur. Ce tableau est dérivé
   de la réponse la plus récente à la commande <a href="https://www.mongodb.com/docs/manual/reference/command/hello/" class="link external">&raquo;&nbsp;hello</a>
   obtenue par la <a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md" class="link external">&raquo;&nbsp;surveillance du serveur</a>.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Lorsque le pilote est connecté à un équilibreur de charge, cette méthode retourne
    la réponse à la commande <a href="https://www.mongodb.com/docs/manual/reference/command/hello/" class="link external">&raquo;&nbsp;hello</a>
    du serveur de backing lors de la poignée de main initiale de la connexion.
    Cela contraste avec d&#039;autres méthodes (par exemple, <span class="function"><a href="mongodb-driver-server.gettype.php" class="function">MongoDB\Driver\Server::getType()</a></span>),
    qui renverront des informations sur l&#039;équilibreur de charge lui-même.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-driver-server.getinfo-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">Cette fonction ne contient aucun paramètre.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-driver-server.getinfo-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne un tableau d&#039;informations décrivant ce serveur.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-driver-server.getinfo-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <ul class="simplelist">
   <li>Lance une exception <span class="classname"><strong class="classname">MongoDB\Driver\InvalidArgumentException</strong></span> lors d'une erreur survenue pendant l'analyse d'un argument.</li>
  </ul>
 </div>



 <div class="refsect1 examples" id="refsect1-mongodb-driver-server.getinfo-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple avec <span class="function"><strong>MongoDB\Driver\Server::getInfo()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$manager </span><span style="color: #007700">= new </span><span style="color: #0000BB">MongoDB\Driver\Manager</span><span style="color: #007700">(</span><span style="color: #DD0000">'mongodb://localhost:27017/'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$rp </span><span style="color: #007700">= new </span><span style="color: #0000BB">MongoDB\Driver\ReadPreference</span><span style="color: #007700">(</span><span style="color: #DD0000">'primary'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$server </span><span style="color: #007700">= </span><span style="color: #0000BB">$manager</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectServer</span><span style="color: #007700">(</span><span style="color: #0000BB">$rp</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$server</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getInfo</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">array(23) {
  [&quot;helloOk&quot;]=&gt;
  bool(true)
  [&quot;topologyVersion&quot;]=&gt;
  array(2) {
    [&quot;processId&quot;]=&gt;
    object(MongoDB\BSON\ObjectId)#4 (1) {
      [&quot;oid&quot;]=&gt;
      string(24) &quot;617b6d696a3a89d2f77e6df0&quot;
    }
    [&quot;counter&quot;]=&gt;
    int(6)
  }
  [&quot;hosts&quot;]=&gt;
  array(1) {
    [0]=&gt;
    string(15) &quot;localhost:27017&quot;
  }
  [&quot;setName&quot;]=&gt;
  string(3) &quot;rs0&quot;
  [&quot;setVersion&quot;]=&gt;
  int(1)
  [&quot;ismaster&quot;]=&gt;
  bool(true)
  [&quot;secondary&quot;]=&gt;
  bool(false)
  [&quot;primary&quot;]=&gt;
  string(15) &quot;localhost:27017&quot;
  [&quot;me&quot;]=&gt;
  string(15) &quot;localhost:27017&quot;
  [&quot;electionId&quot;]=&gt;
  object(MongoDB\BSON\ObjectId)#5 (1) {
    [&quot;oid&quot;]=&gt;
    string(24) &quot;7fffffff0000000000000001&quot;
  }
  [&quot;lastWrite&quot;]=&gt;
  array(4) {
    [&quot;opTime&quot;]=&gt;
    array(2) {
      [&quot;ts&quot;]=&gt;
      object(MongoDB\BSON\Timestamp)#6 (2) {
        [&quot;increment&quot;]=&gt;
        string(1) &quot;1&quot;
        [&quot;timestamp&quot;]=&gt;
        string(10) &quot;1635478989&quot;
      }
      [&quot;t&quot;]=&gt;
      int(1)
    }
    [&quot;lastWriteDate&quot;]=&gt;
    object(MongoDB\BSON\UTCDateTime)#7 (1) {
      [&quot;milliseconds&quot;]=&gt;
      string(13) &quot;1635478989000&quot;
    }
    [&quot;majorityOpTime&quot;]=&gt;
    array(2) {
      [&quot;ts&quot;]=&gt;
      object(MongoDB\BSON\Timestamp)#8 (2) {
        [&quot;increment&quot;]=&gt;
        string(1) &quot;1&quot;
        [&quot;timestamp&quot;]=&gt;
        string(10) &quot;1635478989&quot;
      }
      [&quot;t&quot;]=&gt;
      int(1)
    }
    [&quot;majorityWriteDate&quot;]=&gt;
    object(MongoDB\BSON\UTCDateTime)#9 (1) {
      [&quot;milliseconds&quot;]=&gt;
      string(13) &quot;1635478989000&quot;
    }
  }
  [&quot;maxBsonObjectSize&quot;]=&gt;
  int(16777216)
  [&quot;maxMessageSizeBytes&quot;]=&gt;
  int(48000000)
  [&quot;maxWriteBatchSize&quot;]=&gt;
  int(100000)
  [&quot;localTime&quot;]=&gt;
  object(MongoDB\BSON\UTCDateTime)#10 (1) {
    [&quot;milliseconds&quot;]=&gt;
    string(13) &quot;1635478992136&quot;
  }
  [&quot;logicalSessionTimeoutMinutes&quot;]=&gt;
  int(30)
  [&quot;connectionId&quot;]=&gt;
  int(3)
  [&quot;minWireVersion&quot;]=&gt;
  int(0)
  [&quot;maxWireVersion&quot;]=&gt;
  int(13)
  [&quot;readOnly&quot;]=&gt;
  bool(false)
  [&quot;ok&quot;]=&gt;
  float(1)
  [&quot;$clusterTime&quot;]=&gt;
  array(2) {
    [&quot;clusterTime&quot;]=&gt;
    object(MongoDB\BSON\Timestamp)#11 (2) {
      [&quot;increment&quot;]=&gt;
      string(1) &quot;1&quot;
      [&quot;timestamp&quot;]=&gt;
      string(10) &quot;1635478989&quot;
    }
    [&quot;signature&quot;]=&gt;
    array(2) {
      [&quot;hash&quot;]=&gt;
      object(MongoDB\BSON\Binary)#12 (2) {
        [&quot;data&quot;]=&gt;
        string(20) &quot;&quot;
        [&quot;type&quot;]=&gt;
        int(0)
      }
      [&quot;keyId&quot;]=&gt;
      int(0)
    }
  }
  [&quot;operationTime&quot;]=&gt;
  object(MongoDB\BSON\Timestamp)#13 (2) {
    [&quot;increment&quot;]=&gt;
    string(1) &quot;1&quot;
    [&quot;timestamp&quot;]=&gt;
    string(10) &quot;1635478989&quot;
  }
}</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongodb-driver-server.getinfo-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL mongodb 1.11.0</td>
       <td>
        Lorsque le pilote est connecté à un équilibreur de charge,
        cette méthode renvoie la réponse de la commande <code class="literal">hello</code> du serveur
        de backing à partir de la poignée de main de connexion initiale.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-driver-server.getinfo-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="mongodb-driver-serverdescription.gethelloresponse.php" class="function" rel="rdfs-seeAlso">MongoDB\Driver\ServerDescription::getHelloResponse()</a> - Renvoie la r&eacute;ponse &quot;hello&quot; la plus r&eacute;cente du serveur</span></li>
   <li>Commande <a href="https://www.mongodb.com/docs/manual/reference/command/hello/" class="link external">&raquo;&nbsp;hello</a> dans le manuel de MongoDB</li>
   <li><a href="https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md" class="link external">&raquo;&nbsp;Spécification de la découverte et de la surveillance des serveurs</a></li>
  </ul>
 </div>


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