PHP class for discovering information about a provided MongoDB connection
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mongo
README.markdown

README.markdown

This class will take a Mongo connection object (see http://php.net/mongo), determine the type of connection (single server, replica set, sharded) and recursively connect to each server to determine some basic details about the server (version, hostname, port, memory utilization, etc).

<?php

require_once('mongo/Stat.class.php');

$mongo = new Mongo('mongodb://127.0.0.1:27017', array('replicaSet' => false));
$info = Mongo_Stat::getConnectionDetails($mongo);

var_dump($info);