svn: /phpdoc/en/trunk/reference/mongo/ configure.xml connecting.xml

From: Date: Thu, 11 Mar 2010 17:44:33 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/ configure.xml connecting.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6190@lists.php.net to get a copy of this message
kristina Thu, 11 Mar 2010 17:44:33 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296083 Log: added replica pair example, ws Changed paths: U phpdoc/en/trunk/reference/mongo/configure.xml U phpdoc/en/trunk/reference/mongo/connecting.xml Modified: phpdoc/en/trunk/reference/mongo/configure.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/configure.xml 2010-03-11 17:44:11 UTC (rev 296082) +++ phpdoc/en/trunk/reference/mongo/configure.xml 2010-03-11 17:44:33 UTC (rev 296083) @@ -65,7 +65,9 @@ Add the following line to your php.ini file: <programlisting> <![CDATA[ + extension=mongo.so + ]]> </programlisting> </para> @@ -85,11 +87,13 @@ <programlisting> <![CDATA[ + $ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz $ cd mongodb-mongodb-php-driver-<commit_id> $ phpize $ ./configure $ sudo make install + ]]> </programlisting> </para> @@ -103,7 +107,9 @@ 1. The build will display where it is installing the PHP driver with output that looks something like: <programlisting> <![CDATA[ + Installing '/usr/lib/php/extensions/no-debug-zts-20060613/mongo.so' + ]]> </programlisting> @@ -111,9 +117,11 @@ <programlisting> <![CDATA[ + $ php -i | grep extension_dir extension_dir => /usr/lib/php/extensions/no-debug-zts-20060613 => /usr/lib/php/extensions/no-debug-zts-20060613 + ]]> </programlisting> @@ -126,7 +134,9 @@ <programlisting> <![CDATA[ + extension=mongo.so + ]]> </programlisting> @@ -147,7 +157,9 @@ following command: <programlisting> <![CDATA[ + sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo + ]]> </programlisting> </para> @@ -161,7 +173,9 @@ extension directory. Add <programlisting> <![CDATA[ + extension=mongo.so + ]]> </programlisting> to the php.ini file being used and restart the server. @@ -175,7 +189,9 @@ <programlisting> <![CDATA[ + $ phpize && aclocal && autoconf && ./configure && make && make install + ]]> </programlisting> @@ -191,9 +207,11 @@ mongo.ini file. Put the following in your mongo.ini file: <programlisting> <![CDATA[ + extension=mongo.so ; any other mongo options you'd like (see the Runtime Configuration section) + ]]> </programlisting> </para> @@ -271,7 +289,9 @@ Add the following line to your php.ini file: <programlisting> <![CDATA[ + extension=php_mongo.dll + ]]> </programlisting> </para> Modified: phpdoc/en/trunk/reference/mongo/connecting.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/connecting.xml 2010-03-11 17:44:11 UTC (rev 296082) +++ phpdoc/en/trunk/reference/mongo/connecting.xml 2010-03-11 17:44:33 UTC (rev 296083) @@ -70,4 +70,42 @@ </programlisting> </section> + <section> + <title>Replica Pairs</title> + <para> + To connect to a replica pair, specify both sides of the pair. + </para> + <programlisting role="php"> +<![CDATA[ +<?php + +$m = new Mongo("mongodb://localhost:27017,localhost:27018"); + +?> +]]> + </programlisting> + <para> + Order is irrelevant, the PHP driver will query the database servers to figure + out which one is master. So long as one of them is up and master, the + connection will succeed. If neither is up or there is no master, a + <classname>MongoConnectionException</classname> will be thrown. + </para> + <para> + If the master becomes unavailable, the slave will not become master for a few + seconds. During that time, the driver will not be able to perform any + database operations because the master database is gone and the other + database is a slave. Thus, if you attempt to do any sort of query (including + "safe" operations) they will throw exceptions. + </para> + <para> + The slave will eventually realize that the master is gone and become master + itself. At this point, the driver will make this its primary database + connection and continue operating normally. + </para> + <para> + For more information on replica pairs, see the + <link xlink:href="&url.mongodb.replica;">core documentation</link>. + </para> + </section> + </section>

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