domain socket support

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301915 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kristina Chodorow 2010-08-05 22:18:37 +00:00
parent befe9b2375
commit c30d564338

View file

@ -165,4 +165,47 @@ for ($i=0; $i<1000; $i++) {
</para>
</section>
<section>
<title>Domain Socket Support</title>
<para>
If you are running MongoDB locally and have version 1.0.9 or better of the
driver, you can connect to the database via file. MongoDB automatically
opens a socket file on startup: /tmp/mongodb-&lt;port&gt;.sock
(C:\tmp\mongodb-&lt;27017&gt;.sock on Windows).
</para>
<para>
To connect to the socket file, specify the path in your MongoDB connection
string:
</para>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo("mongodb:///tmp/mongo-27017.sock");
?>
]]>
</programlisting>
<para>
If you would like to use authentication on connection (as described above)
with a socket file, you must specify a port of 0 so that the connection
string parser knows where the end of the connection string is.
</para>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo("mongodb://username:password@/tmp/mongo-27017.sock:0/foo");
?>
]]>
</programlisting>
</section>
</section>