mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
befe9b2375
commit
c30d564338
1 changed files with 43 additions and 0 deletions
|
@ -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-<port>.sock
|
||||
(C:\tmp\mongodb-<27017>.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>
|
||||
|
|
Loading…
Reference in a new issue