/** * Connect * * This method setup parameters to connect to a MongoDB * database. The connection is done when it is needed. * * @param string $db Database name * @param string $host Host to connect * @param string $user User (Auth) * @param string $pwd Password (Auth) * * @return void */ public static final function connect($db, $host = 'localhost', $user = NULL, $pwd = NULL) { self::$_host = $host; self::$_db = $db; self::$_user = $user; self::$_pwd = $pwd; }