mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
updated constructor params
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@308607 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
cb0f35a0e4
commit
8836adc497
1 changed files with 1 additions and 28 deletions
|
@ -13,8 +13,6 @@
|
|||
<methodname>Mongo::__construct</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>server</parameter><initializer>"mongodb://localhost:27017"</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>array("connect" => &true;)</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>persist</parameter><initializer>false</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>garbage</parameter><initializer>false</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
If no parameters are passed, this connects to "localhost:27017" (or whatever
|
||||
|
@ -51,31 +49,6 @@ mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db
|
|||
to authenticate with. If <literal>db</literal> is not specified, "admin"
|
||||
will be used.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you elect not to connect immediately (you pass the option
|
||||
<literal>array("connect" => false)</literal>), you will need to call
|
||||
<function>Mongo::connect</function> before doing any database operations.
|
||||
</para>
|
||||
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$mongo = new Mongo("mongodb://localhost", array("connect" => false));
|
||||
|
||||
// throws a MongoException, as $mongo has not been fully initialized yet
|
||||
$mongo->selectDB("foo")->command(array("distinct" => "bar", "key" => "age"));
|
||||
|
||||
// okay
|
||||
$mongo->connect();
|
||||
$mongo->selectDB("foo")->command(array("distinct" => "bar", "key" => "age"));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -259,7 +232,7 @@ $mongo->selectDB("foo")->command(array("distinct" => "bar", "key" => "age"));
|
|||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.1.4</entry>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added the <literal>username</literal> and <literal>password</literal>
|
||||
options.
|
||||
|
|
Loading…
Reference in a new issue