svn: /phpdoc/en/trunk/reference/mongo/ mongo/construct.xml mongo.xml mongocursor/timeout.xml versions.xml
| From: | Kristina Chodorow | Date: | Thu, 07 Jan 2010 21:59:21 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongo/ mongo/construct.xml mongo.xml mongocursor/timeout.xml versions.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5784@lists.php.net to get a copy of this message | ||
kristina Thu, 07 Jan 2010 21:59:21 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=293232
Log:
added timeout, updated constructor
Changed paths:
U phpdoc/en/trunk/reference/mongo/mongo/construct.xml
U phpdoc/en/trunk/reference/mongo/mongo.xml
A phpdoc/en/trunk/reference/mongo/mongocursor/timeout.xml
U phpdoc/en/trunk/reference/mongo/versions.xml
Modified: phpdoc/en/trunk/reference/mongo/mongo/construct.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongo/construct.xml 2010-01-07 20:22:18 UTC (rev 293231)
+++ phpdoc/en/trunk/reference/mongo/mongo/construct.xml 2010-01-07 21:59:21 UTC (rev 293232)
@@ -34,6 +34,19 @@
it could not connect to any of the hosts, it will throw a
<classname>MongoConnectionException</classname>.
</para>
+
+ <warning>
+
+ <title><parameter>server</parameter> Format</title>
+
+ <para>
+ Before version 1.0.2, <parameter>server</parameter> could not be prefixed
+ with <literal>mongodb://</literal>, contain username and password, or
+ contain more than two hostnames. See the changelog below for more details.
+ </para>
+
+ </warning>
+
<para>
If you elect not to connect immediately (you pass the option
<literal>array("connect" => false)</literal>), you will need to call
Modified: phpdoc/en/trunk/reference/mongo/mongo.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongo.xml 2010-01-07 20:22:18 UTC (rev 293231)
+++ phpdoc/en/trunk/reference/mongo/mongo.xml 2010-01-07 21:59:21 UTC (rev 293232)
@@ -21,59 +21,13 @@
<?php
$m = new Mongo(); // connect
-$db = $m->selectDB("foo"); // get a database object
+$db = $m->foo; // get the database named "foo"
?>
]]>
</programlisting>
</para>
-
<para>
- This class has two static fields: <varname>Mongo::$connections</varname> and
- <varname>Mongo::$pconnections</varname> which track the number of open
- connections and persistent connections, respectively.
- <varname>Mongo::$connections</varname> is inclusive, it basically counts all
- open sockets, including persistent connections.
- </para>
- <para>
- An example of how different types of connections affect these variables:
- <programlisting>
-<![CDATA[
-<?php
-
-/*
- * start:
- * Mongo::$connections is 0
- * Mongo::$pconnections is 0
- */
-
-$m1 = new Mongo();
-
-/*
- * Mongo::$connections is 1
- * Mongo::$pconnections is 0
- */
-
-$m2 = new Mongo("localhost", array("persist" => "foo"));
-
-/*
- * Mongo::$connections is 2
- * Mongo::$pconnections is 1
- */
-
-// reuse persistent connection
-$m3 = new Mongo("localhost", array("persist" => "foo"));
-
-/*
- * Mongo::$connections is 2
- * Mongo::$pconnections is 1
- */
-
-?>
-]]>
- </programlisting>
- </para>
- <para>
See <function>Mongo::__construct</function> for more information about
creating connections.
</para>
@@ -114,22 +68,6 @@
<initializer>27017</initializer>
</fieldsynopsis>
- <classsynopsisinfo role="comment">Static Fields</classsynopsisinfo>
- <fieldsynopsis>
- <modifier>public</modifier>
- <modifier>static</modifier>
- <type>int</type>
- <varname>connections</varname>
- <initializer>0</initializer>
- </fieldsynopsis>
- <fieldsynopsis>
- <modifier>public</modifier>
- <modifier>static</modifier>
- <type>int</type>
- <varname>pconnections</varname>
- <initializer>0</initializer>
- </fieldsynopsis>
-
<classsynopsisinfo role="comment">Fields</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
Added: phpdoc/en/trunk/reference/mongo/mongocursor/timeout.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongocursor/timeout.xml (rev 0)
+++ phpdoc/en/trunk/reference/mongo/mongocursor/timeout.xml 2010-01-07 21:59:21 UTC (rev 293232)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- $Revision$ -->
+<refentry xml:id="mongocursor.timeout" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>MongoCursor::timeout</refname>
+ <refpurpose>Sets a client-side timeout for this query</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <modifier>public</modifier>
<type>MongoCursor</type><methodname>MongoCursor::timeout</methodname>
+
<methodparam><type>int</type><parameter>ms</parameter></methodparam>
+ </methodsynopsis>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <variablelist>
+ <varlistentry>
+ <term>
+ <parameter>ms</parameter>
+ </term>
+ <listitem>
+ <para>
+ The number of milliseconds for the cursor to wait for a response. By
+ default, the cursor will wait forever.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ This cursor.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><function>MongoCursor::timeout</function> example</title>
+ <para>
+ A query where the cursor waits for one second for a response.
+ </para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$cursor = $collection->find()->timeout(1000);
+
+try {
+ foreach ($cursor as $value) {
+ print_r($value);
+ }
+}
+catch(MongoCursorTimeoutException $e) {
+ echo "query took too long!";
+}
+
+?>
+]]>
+ </programlisting>
+ </example>
+ </refsect1>
+
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ Causes methods that fetch results to throw
+ <classname>MongoCursorTimeoutException</classname>s if the query takes longer
+ than the number of milliseconds specified.
+ </para>
+ </refsect1>
+</refentry>
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Property changes on: phpdoc/en/trunk/reference/mongo/mongocursor/timeout.xml
___________________________________________________________________
Added: svn:keywords
+ Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
Modified: phpdoc/en/trunk/reference/mongo/versions.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/versions.xml 2010-01-07 20:22:18 UTC (rev 293231)
+++ phpdoc/en/trunk/reference/mongo/versions.xml 2010-01-07 21:59:21 UTC (rev 293232)
@@ -70,6 +70,7 @@
<function name='mongocursor::next' from='PECL mongo >=0.9.0'/>
<function name='mongocursor::skip' from='PECL mongo >=0.9.0'/>
<function name='mongocursor::sort' from='PECL mongo >=0.9.0'/>
+ <function name='mongocursor::timeout' from='PECL mongo >=1.0.3'/>
<function name='mongocursor::current' from='PECL mongo >=0.9.0'/>
<function name='mongocursor::reset' from='PECL mongo >=0.9.0'/>
<function name='mongocursor::rewind' from='PECL mongo >=0.9.0'/>
@@ -105,6 +106,7 @@
<!-- MongoId -->
<function name='mongoid::__construct' from='PECL mongo >=
0.8.0'/>
+ <function name='mongoid::getTimestamp' from='PECL mongo >=
1.0.1'/>
<function name='mongoid::__tostring' from='PECL mongo >= 0.8.0'/>
<!-- MongoRegex -->
<function name='mongoregex::__construct' from='PECL mongo >=
0.8.1'/>