MongoClient::getConnections PHP Method

getConnections() public static method

Return info about all open connections
public static getConnections ( ) : array
return array - An array of open connections.
    public static function getConnections()
    {
        throw new Exception('Not Implemented');
    }

Usage Example

Beispiel #1
0
 /**
  * Forcefully closes a connection to the database,
  * even if persistent connections are being used.
  *
  * [!!] This is called automatically by [\Gleez\Mango\Client::__destruct].
  */
 public function disconnect()
 {
     if ($this->isConnected()) {
         $connections = $this->connection->getConnections();
         foreach ($connections as $connection) {
             // Close the connection to Mongo
             $this->connection->close($connection['hash']);
         }
         $this->db = $this->benchmark = null;
         $this->connected = false;
     }
 }
All Usage Examples Of MongoClient::getConnections