mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00

Patch provided by anon users. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341136 c90b9560-bf6c-de11-be94-00142212c4b1
340 lines
10 KiB
XML
340 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<section xml:id="mongo.configuration" xmlns="http://docbook.org/ns/docbook">
|
|
&reftitle.runtime;
|
|
&extension.runtime;
|
|
<para>
|
|
<table>
|
|
<title>Mongo &ConfigureOptions;</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>&Name;</entry>
|
|
<entry>&Default;</entry>
|
|
<entry>&Changeable;</entry>
|
|
<entry>&Changelog;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody xml:id="mongo.configuration.list">
|
|
<row>
|
|
<entry><link linkend="ini.mongo.allow-empty-keys">mongo.allow_empty_keys</link></entry>
|
|
<entry>0</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.allow-persistent">mongo.allow_persistent</link></entry>
|
|
<entry>1</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry>Removed in 1.2.0</entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.chunk-size">mongo.chunk_size</link></entry>
|
|
<entry>262144</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.cmd">mongo.cmd</link></entry>
|
|
<entry>"$"</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.default-host">mongo.default_host</link></entry>
|
|
<entry>"localhost"</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.default-port">mongo.default_port</link></entry>
|
|
<entry>27017</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.is-master-interval">mongo.is_master_interval</link></entry>
|
|
<entry>15</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry>Added in 1.2.10, before 1.3.0 the default value was 60.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.long-as-object">mongo.long_as_object</link></entry>
|
|
<entry>0</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.native-long">mongo.native_long</link></entry>
|
|
<entry>1</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry>Before 1.5.0, the default value was 0.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.ping-interval">mongo.ping_interval</link></entry>
|
|
<entry>5</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry>Added in 1.2.10</entry>
|
|
</row>
|
|
<row>
|
|
<entry><link linkend="ini.mongo.utf8">mongo.utf8</link></entry>
|
|
<entry>1</entry>
|
|
<entry>PHP_INI_ALL</entry>
|
|
<entry></entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
&ini.php.constants;
|
|
</para>
|
|
|
|
&ini.descriptions.title;
|
|
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry xml:id="ini.mongo.allow-empty-keys">
|
|
<term>
|
|
<parameter>mongo.allow_empty_keys</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Added in version 1.0.11.
|
|
</para>
|
|
<para>
|
|
If empty strings ("") should be allowed as key names. By default, the
|
|
driver will throw an exception if you attempt to pass the empty string as
|
|
a key to the database. It is extremely easy to do this inavertently by
|
|
using double quotes with $-operators, so it is recommended that you leave
|
|
this setting as default. However, if you need to save keys that are empty
|
|
strings, you can set this option to true and the driver will allow you to
|
|
pass empty strings to the database.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.allow-persistent">
|
|
<term>
|
|
<parameter>mongo.allow_persistent</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
If persistent connections are allowed. (Removed in 1.2.0 - all
|
|
connections are now persistent).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.chunk-size">
|
|
<term>
|
|
<parameter>mongo.chunk_size</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
The number of bytes-per-chunk. Used in divvying up GridFS files. This
|
|
number must be at least 100 less than 4 megabytes (max: 4194204) and it is
|
|
recommended that it be less than that.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.cmd">
|
|
<term>
|
|
<parameter>mongo.cmd</parameter>
|
|
<type>string</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
A character to be used in place of $ in modifiers and comparisons.
|
|
</para>
|
|
<para>
|
|
As it is easy to forget to escape the "$", you can also choose your own
|
|
special character to use instead of '$'. Choose a character that will not
|
|
occur in your key names, e.g. ":":
|
|
</para>
|
|
<programlisting role="ini">
|
|
<![CDATA[
|
|
mongo.cmd = ":"
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Then, to do a comparison, for example:
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$query = array( "i" => array( ":gt" => 20, ":lte" => 30 ) );
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
You can also change it in your code using
|
|
<literal>ini_set("mongo.cmd", ":")</literal>. Of course, you can also
|
|
just use single quotes or backslash-escape the $.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.default-host">
|
|
<term>
|
|
<parameter>mongo.default_host</parameter>
|
|
<type>string</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Default hostname when nothing is passed to the constructor.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.default-port">
|
|
<term>
|
|
<parameter>mongo.default_port</parameter>
|
|
<type>string</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
The default TCP port number to use when connecting to the database server
|
|
if no other port is specified. The database's default is
|
|
<literal>27017</literal>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.is-master-interval">
|
|
<term>
|
|
<parameter>mongo.is_master_interval</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Added in version 1.2.10.
|
|
</para>
|
|
<para>
|
|
For replicaset connections: The minimum interval with which the driver
|
|
will send "isMaster" requests to the MongoDB server. If the value is lower,
|
|
there will be more requests, but the driver finds faster whether the
|
|
topology of the replicaset has been changed.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.long-as-object">
|
|
<term>
|
|
<parameter>mongo.long_as_object</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Return a BSON_LONG as an instance of <classname>MongoInt64</classname>
|
|
(instead of a primitive type).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.native-long">
|
|
<term>
|
|
<parameter>mongo.native_long</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
<emphasis>
|
|
The default behavior for this has been changed to &true; in 1.5.0, so make
|
|
sure to set this variable to the value you want (probably &true;) so that
|
|
the driver's behavior doesn't suddenly change when you upgrade.
|
|
</emphasis>
|
|
</para>
|
|
<para>
|
|
On 64-bit platforms, the <literal>mongo.native_long</literal> setting
|
|
allows for 64-bit integers to be stored in MongoDB. If it is not set, only
|
|
32-bits of the integer will be saved. The MongoDB data type that is used
|
|
in this case is the BSON LONG, instead of the BSON INT that is used if
|
|
this setting is turned off.
|
|
</para>
|
|
<para>
|
|
The setting also changes the way how BSON LONGs behave when they are read
|
|
back from MongoDB. Without <literal>mongo.native_long</literal> enabled,
|
|
the driver would convert every BSON LONG to a PHP double which can result
|
|
in a loss of precision.
|
|
</para>
|
|
<para>
|
|
On 32-bit platforms, the <literal>mongo.native_long</literal> setting
|
|
changes nothing for storing integers in MongoDB: the integer is stored
|
|
as a BSON INT as before. However, when the setting is enabled and a
|
|
BSON LONG is read from MongoDB a
|
|
<classname>MongoCursorException</classname> is thrown alerting you that
|
|
the data could not be read back without losing precision.
|
|
</para>
|
|
<para>
|
|
On 32-bit systems especially, it is recommended that you combine this with
|
|
enabling <literal>mongo.long_as_object</literal>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.ping-interval">
|
|
<term>
|
|
<parameter>mongo.ping_interval</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Added in version 1.2.10.
|
|
</para>
|
|
<para>
|
|
For replicaset connections: The minimum interval with which the driver
|
|
will send "ping" requests to the MongoDB server. If the value is lower,
|
|
there will be more pings, but the driver finds faster whether a node is
|
|
no longer reachable from the replicaset.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry xml:id="ini.mongo.utf8">
|
|
<term>
|
|
<parameter>mongo.utf8</parameter>
|
|
<type>int</type>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
If an exception should be thrown for non-UTF8 strings. Until version
|
|
1.0.4, the PHP driver would ignore non-UTF8 strings, even though you're
|
|
not supposed to insert them. As of 1.0.4, the driver throws a
|
|
<classname>MongoException</classname>. To ease the transition for
|
|
applications that insert non-UTF8 strings, you can turn this option off to
|
|
emulate the old, non-exception-throwning behavior. This option will be
|
|
eliminated and exceptions always thrown for non-UTF8 strings starting with
|
|
version 1.1.0.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
</para>
|
|
</section>
|
|
|
|
<!-- 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
|
|
indent-tabs-mode:nil
|
|
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
|
|
-->
|