svn: /phpdoc/en/trunk/reference/mongo/mongo/ construct.xml

From: Date: Mon, 22 Feb 2010 21:21:22 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/mongo/ construct.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6117@lists.php.net to get a copy of this message
kristina Mon, 22 Feb 2010 21:21:22 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=295380 Log: added db auth syntax Changed paths: U phpdoc/en/trunk/reference/mongo/mongo/construct.xml Modified: phpdoc/en/trunk/reference/mongo/mongo/construct.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongo/construct.xml 2010-02-22 19:29:54 UTC (rev 295379) +++ phpdoc/en/trunk/reference/mongo/mongo/construct.xml 2010-02-22 21:21:22 UTC (rev 295380) @@ -22,18 +22,33 @@ </para> <para> As of version 1.0.2, <parameter>server</parameter> can have a special form: - <literal>mongodb://[username:password@]host1[:port1][,host2[:port2:],...]</literal>. - Breaking this down, it starts with <literal>mongodb://</literal>, to indicate - it is in this form. If <literal>username</literal> and <literal>password</literal> + <programlisting> +<![CDATA[ +mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db +]]> + </programlisting> + </para> + <para> + It starts with <literal>mongodb://</literal>, to indicate it is a connection + string in this form. + </para> + <para>If <literal>username</literal> and <literal>password</literal> are specified, the constructor will attempt to authenticate the connection - with the admin database before returning. Username and password are optional - and must be followed by an <literal>@</literal>, if specified. At least one - host must be given (port optional, always defaulting to 27017) and as many - hosts as desired may be connected to. Host names are comma-separated and the - constructor will return successfully if it connected to at least one host. If - it could not connect to any of the hosts, it will throw a - <classname>MongoConnectionException</classname>. + with the database before returning. Username and password are optional + and must be followed by an <literal>@</literal>, if specified. </para> + <para> + At least one host must be given (port optional, always defaulting to 27017) + and as many hosts as desired may be connected to. Host names are + comma-separated and the constructor will return successfully if it connected + to at least one host. If it could not connect to any of the hosts, it will + throw a <classname>MongoConnectionException</classname>. + </para> + <para> + Finally, if you specified a username and password, you may specify a database + to authenticate with. If <literal>db</literal> is not specified, "admin" + will be used. + </para> <warning>

« previous php.doc.cvs (#6117) next »