class Mongo
{
private static $client;
private static $mongoDb;
private function __construct()
{
self::$client = new \MongoDB\Driver\Manager("mongodb://账号:密码@ip:端口");
}
private function __clone()
{
}
public static function get_instance()
{
if(!self::$mongoDb instanceof self){
return new self();
}
return self::$mongoDb;
}
public static function get_client()
{
return self::$client;
}
}