MongoClient
PHP Manual

MongoClient::getConnections

(PECL mongo >=1.3.0)

MongoClient::getConnectionsRetourne des informations sur toutes les connexions ouvertes

This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. There is no equivalent for this method in the new extension.

Description

public static array MongoClient::getConnections ( void )

Retourne un tableau de toutes les connexions ouvertes, et des informations à propos de chaque serveur.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Un tableau de connexions ouvertes.

Exemples

Exemple #1 Exemple avec MongoClient::getConnections()

<?php
$m 
= new MongoClient;
var_dump($m->getConnections());
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

array(1) {
  [0]=>
  array(3) {
    ["hash"]=>
    string(26) "localhost:27017;-;X;56052"
    ["server"]=>
    array(3) {
      ["host"]=>
      string(10) "localhost"
      ["port"]=>
      int(27017)
      ["pid"]=>
      int(56052)
    }
    ["connection"]=>
    array(8) {
      ["last_ping"]=>
      int(1354076401)
      ["last_ismaster"]=>
      int(0)
      ["ping_ms"]=>
      int(0)
      ["connection_type"]=>
      int(1)
      ["connection_type_desc"]=>
      string(10) "STANDALONE"
      ["max_bson_size"]=>
      int(16777216)
      ["tag_count"]=>
      int(0)
      ["tags"]=>
      array(0) {
      }
    }
  }
}

MongoClient
PHP Manual