mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
memcache : fix XML by converting para to simpara tags via script
This commit is contained in:
@@ -1,29 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<book xml:id="book.memcache" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.memcache">
|
||||
<?phpdoc extension-membership="pecl" ?>
|
||||
<title>Memcache</title>
|
||||
|
||||
|
||||
<!-- {{{ preface -->
|
||||
<preface xml:id="intro.memcache">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
<simpara>
|
||||
Memcache module provides handy procedural and object-oriented interface
|
||||
to memcached, highly effective caching daemon, which was especially
|
||||
designed to decrease database load in dynamic web applications.
|
||||
</para>
|
||||
<para>
|
||||
The Memcache module also provides a <link
|
||||
linkend="ref.session">session</link> handler (<literal>memcache</literal>).
|
||||
</para>
|
||||
<para>
|
||||
More information about memcached can be found at <link
|
||||
xlink:href="&url.memcache;">&url.memcache;</link>.
|
||||
</para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
The Memcache module also provides a <link linkend="ref.session">session</link> handler (<literal>memcache</literal>).
|
||||
</simpara>
|
||||
<simpara>
|
||||
More information about memcached can be found at <link xlink:href="&url.memcache;">&url.memcache;</link>.
|
||||
</simpara>
|
||||
</preface>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
&reference.memcache.setup;
|
||||
&reference.memcache.constants;
|
||||
&reference.memcache.examples;
|
||||
@@ -31,7 +28,6 @@
|
||||
&reference.memcache.reference;
|
||||
|
||||
</book>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -52,4 +48,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<section xml:id="memcache.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="memcache.installation">
|
||||
&reftitle.install;
|
||||
<para>
|
||||
<simpara>
|
||||
&pecl.moved;
|
||||
&pecl.info;
|
||||
<link xlink:href="&url.pecl.package;memcache">&url.pecl.package;memcache</link>.
|
||||
</para>
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
It's possible to disable memcache session handler support. The 'pecl install' option
|
||||
prompts for this (default is enabled) however when compiling statically into PHP the
|
||||
<option role="configure">--disable-memcache-session</option> configure option may be
|
||||
used.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</section>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<title>Basic usage</title>
|
||||
<example>
|
||||
<title>memcache extension overview example</title>
|
||||
<para>
|
||||
<simpara>
|
||||
In this example, an object is being saved in the cache and then
|
||||
retrieved back. Object and other non-scalar types are serialized
|
||||
before saving, so it's impossible to store resources (i.e. connection
|
||||
identifiers and others) in the cache.
|
||||
</para>
|
||||
</simpara>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<parameter>on_off</parameter> is equal to &true; and turns off if it's
|
||||
&false;.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
<function>memcache_debug</function> is accessible only if PHP was built
|
||||
with --enable-debug option and always returns &true; in this case.
|
||||
Otherwise, this function has no effect and always returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
<varlistentry>
|
||||
<term><parameter>on_off</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Turns debug output on if equals to &true;.
|
||||
Turns debug output off if equals to &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -45,10 +45,10 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns &true; if PHP was built with --enable-debug option, otherwise
|
||||
returns &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
@@ -125,10 +125,10 @@
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Whether to transparently failover to other servers on
|
||||
errors.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -138,10 +138,10 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Defines how many servers to try when setting and getting data.
|
||||
Used only in conjunction with memcache.allow_failover.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -151,12 +151,12 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Data will be transferred in chunks of this size, setting
|
||||
the value lower requires more network writes. Try
|
||||
increasing this value to 32768 if noticing otherwise
|
||||
inexplicable slowdowns.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -166,10 +166,10 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The default TCP port number to use when connecting to
|
||||
the memcached server if no other port is specified.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -179,13 +179,13 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls which strategy to use when mapping keys to servers. Set this value to
|
||||
<literal>consistent</literal> to enable consistent hashing which allows servers
|
||||
to be added or removed from the pool without causing keys to be remapped.
|
||||
Setting this value to <literal>standard</literal> results in the old strategy
|
||||
being used.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -195,10 +195,10 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls which hash function to apply when mapping keys to servers, <literal>crc32</literal>
|
||||
uses the standard CRC32 hash while <literal>fnv</literal> uses FNV-1a.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -208,9 +208,9 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -220,9 +220,9 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -232,9 +232,9 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -244,9 +244,9 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -256,9 +256,9 @@
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -268,9 +268,9 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Use memcache as a session handler by setting this value to <literal>memcache</literal>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -280,15 +280,15 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Defines a comma separated of server urls to use for session storage, for example
|
||||
<literal>"tcp://host1:11211, tcp://host2:11211"</literal>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Each url may contain parameters which are applied to that server, they are the same
|
||||
as for the <function>Memcache::addServer</function> method. For example
|
||||
<literal>"tcp://host1:11211?persistent=1&weight=1&timeout=1&retry_interval=15"</literal>
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<reference xml:id="class.memcache" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<reference xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="class.memcache" role="class">
|
||||
|
||||
<title>The Memcache class</title>
|
||||
<titleabbrev>Memcache</titleabbrev>
|
||||
@@ -11,9 +10,9 @@
|
||||
<!-- {{{ Memcache intro -->
|
||||
<section xml:id="memcache.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
<simpara>
|
||||
Represents a connection to a set of memcache servers.
|
||||
</para>
|
||||
</simpara>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
@@ -31,19 +30,18 @@
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.memcache')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.memcache')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])"/>
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.memcache.entities.memcache;
|
||||
|
||||
</reference>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::add</function> stores variable
|
||||
<parameter>var</parameter> with <parameter>key</parameter> only if such
|
||||
key doesn't exist at the server yet.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -39,38 +39,38 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The key that will be associated with the item.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>var</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The variable to store. Strings and integers are stored as is, other
|
||||
types are stored serialized.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flag</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Use <constant>MEMCACHE_COMPRESSED</constant> to store the item
|
||||
compressed (uses zlib).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>expire</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Expiration time of the item. If it's equal to zero, the item will never
|
||||
expire. You can also use Unix timestamp or a number of seconds starting
|
||||
from current time, but in the latter case the number of seconds may not
|
||||
exceed 2592000 (30 days).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -78,12 +78,12 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
Returns &false; if such key already exist. For the rest
|
||||
<function>Memcache::add</function> behaves similarly to
|
||||
<function>Memcache::set</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -35,29 +35,29 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>timeoutms</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::addServer</function> adds a server to the connection pool.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
When using this method (as opposed to <function>Memcache::connect</function> and
|
||||
<function>Memcache::pconnect</function>) the network connection is not established
|
||||
until actually needed. Thus there is no overhead in adding a large number of servers
|
||||
to the pool, even though they might not all be used.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
Failover may occur at any stage in any of the methods, as long as other
|
||||
servers are available the request the user won't notice. Any kind of
|
||||
socket or Memcached server level errors (except out-of-memory) may trigger
|
||||
the failover. Normal client errors such as adding an existing key will not
|
||||
trigger a failover.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This function has been added to Memcache version 2.0.0.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
@@ -68,106 +68,106 @@
|
||||
<varlistentry>
|
||||
<term><parameter>host</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the host where memcached is listening for connections. This parameter
|
||||
may also specify other transports like <literal>unix:///path/to/memcached.sock</literal>
|
||||
to use UNIX domain sockets, in this case <parameter>port</parameter> must also
|
||||
be set to <literal>0</literal>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the port where memcached is listening for connections.
|
||||
Set this
|
||||
parameter to <literal>0</literal> when using UNIX domain sockets.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Please note: <parameter>port</parameter> defaults to
|
||||
<link linkend="ini.memcache.default-port">memcache.default_port</link>
|
||||
if not specified. For this reason it is wise to specify the port
|
||||
explicitly in this method call.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>persistent</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls the use of a persistent connection. Default to &true;.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>weight</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Number of buckets to create for this server which in turn control its
|
||||
probability of it being selected. The probability is relative to the
|
||||
total weight of all servers.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Value in seconds which will be used for connecting to the daemon. Think
|
||||
twice before changing the default value of 1 second - you can lose all
|
||||
the advantages of caching if your connection is too slow.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>retry_interval</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls how often a failed server will be retried, the default value
|
||||
is 15 seconds. Setting this parameter to -1 disables automatic retry.
|
||||
Neither this nor the <parameter>persistent</parameter> parameter has any
|
||||
effect when the extension is loaded dynamically via <function>dl</function>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Each failed connection struct has its own timeout and before it has expired
|
||||
the struct will be skipped when selecting backends to serve a request. Once
|
||||
expired the connection will be successfully reconnected or marked as failed
|
||||
for another <parameter>retry_interval</parameter> seconds. The typical
|
||||
effect is that each web server child will retry the connection about every
|
||||
<parameter>retry_interval</parameter> seconds when serving a page.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>status</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls if the server should be flagged as online. Setting this parameter
|
||||
to &false; and <parameter>retry_interval</parameter> to -1 allows a failed
|
||||
server to be kept in the pool so as not to affect the key distribution
|
||||
algorithm. Requests for this server will then failover or fail immediately
|
||||
depending on the <parameter>memcache.allow_failover</parameter> setting.
|
||||
Default to &true;, meaning the server should be considered online.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>failure_callback</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Allows the user to specify a callback function to run upon encountering an
|
||||
error. The callback is run before failover is attempted. The function takes
|
||||
two parameters, the hostname and port of the failed server.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timeoutms</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -175,9 +175,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -208,14 +208,14 @@ memcache_add_server($memcache_obj, 'memcache_host2', 11211);
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<warning>
|
||||
<para>
|
||||
<simpara>
|
||||
When the <parameter>port</parameter> is unspecified, this method defaults to the
|
||||
value set of the PHP ini directive
|
||||
<link linkend="ini.memcache.default-port">memcache.default_port</link>
|
||||
If this value was changed elsewhere in your application it might lead to
|
||||
unexpected results: for this reason it is wise to always specify the port
|
||||
explicitly in this method call.
|
||||
</para>
|
||||
</simpara>
|
||||
</warning>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<methodparam><type>Memcache</type><parameter>memcache</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::close</function> closes connection to memcached
|
||||
server. This function doesn't close persistent connections, which are
|
||||
closed only during web-server shutdown/restart.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::connect</function> establishes a connection to the
|
||||
memcached server.
|
||||
The connection, which was opened using
|
||||
<function>Memcache::connect</function> will be automatically closed at the
|
||||
end of script execution. Also you can close it with
|
||||
<function>Memcache::close</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -39,37 +39,37 @@
|
||||
<varlistentry>
|
||||
<term><parameter>host</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the host where memcached is listening for connections. This parameter
|
||||
may also specify other transports like <literal>unix:///path/to/memcached.sock</literal>
|
||||
to use UNIX domain sockets, in this case <parameter>port</parameter> must also
|
||||
be set to <literal>0</literal>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the port where memcached is listening for connections. Set this
|
||||
parameter to <literal>0</literal> when using UNIX domain sockets.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Please note: <parameter>port</parameter> defaults to
|
||||
<link linkend="ini.memcache.default-port">memcache.default_port</link>
|
||||
if not specified. For this reason it is wise to specify the port
|
||||
explicitly in this method call.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Value in seconds which will be used for connecting to the daemon. Think
|
||||
twice before changing the default value of 1 second - you can lose all
|
||||
the advantages of caching if your connection is too slow.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -77,9 +77,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
@@ -108,14 +108,14 @@ $memcache->connect('memcache_host', 11211);
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<warning>
|
||||
<para>
|
||||
<simpara>
|
||||
When the <parameter>port</parameter> is unspecified, this method defaults to the
|
||||
value set of the PHP ini directive
|
||||
<link linkend="ini.memcache.default-port">memcache.default_port</link>
|
||||
If this value was changed elsewhere in your application it might lead to
|
||||
unexpected results: for this reason it is wise to always specify the port
|
||||
explicitly in this method call.
|
||||
</para>
|
||||
</simpara>
|
||||
</warning>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
being converted to numerical and after that <parameter>value</parameter>
|
||||
is subtracted.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
New item's value will not be less than zero.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
Do not use <function>Memcache::decrement</function> with item, which was
|
||||
stored compressed, because consequent call to
|
||||
<function>Memcache::get</function> will fail.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
<function>Memcache::decrement</function> <emphasis>does not</emphasis>
|
||||
create an item if it didn't exist.
|
||||
@@ -51,17 +51,17 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Key of the item do decrement.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Decrement the item by <parameter>value</parameter>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -69,9 +69,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns item's new value on success&return.falseforfailure;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>exptime</parameter><initializer>0</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::delete</function> deletes an item with the <parameter>key</parameter>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -33,18 +33,18 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The key associated with the item to delete.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>exptime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
This deprecated parameter is not supported, and defaults to <literal>0</literal> seconds.
|
||||
Do not use this parameter.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -52,9 +52,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
<methodparam><type>Memcache</type><parameter>memcache</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::flush</function> immediately invalidates all
|
||||
existing items. <function>Memcache::flush</function> doesn't
|
||||
actually free any resources, it only marks all the items as expired, so
|
||||
occupied memory will be overwritten by new items.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
<methodparam choice="opt"><type>array</type><parameter role="reference">flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::get</function> returns previously stored data of
|
||||
an item, if such <parameter>key</parameter> exists on the server at this
|
||||
moment.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
You can pass array of keys to <function>Memcache::get</function> to get
|
||||
array of values. The result array will contain only found key-value pairs.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -51,20 +51,20 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The key or array of keys to fetch.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
If present, flags fetched along with the values will be written to this parameter. These
|
||||
flags are the same as the ones given to for example <function>Memcache::set</function>.
|
||||
The lowest byte of the int is reserved for pecl/memcache internal usage (e.g. to indicate
|
||||
compression and serialization status).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -72,12 +72,12 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns the value associated with the <parameter>key</parameter> or
|
||||
an array of found key-value pairs when <parameter>key</parameter> is an <type>array</type>.
|
||||
Returns &false; on failure, <parameter>key</parameter> is not found or
|
||||
<parameter>key</parameter> is an empty <type>array</type>.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -23,17 +23,17 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>100</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::getExtendedStats</function> returns a two-dimensional
|
||||
associative array with server statistics. Array keys correspond to
|
||||
host:port of server and values contain the individual server statistics.
|
||||
A failed server will have its corresponding entry set to &false;.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This function has been added to Memcache version 2.0.0.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
@@ -45,32 +45,32 @@
|
||||
<varlistentry>
|
||||
<term><parameter>type</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The type of statistics to fetch. Valid values are {reset,
|
||||
malloc, maps, cachedump, slabs, items, sizes}. According to
|
||||
the memcached protocol spec these additional arguments "are
|
||||
subject to change for the convenience of memcache developers".
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>slabid</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Used in conjunction with <parameter>type</parameter> set to
|
||||
cachedump to identify the slab to dump from. The cachedump
|
||||
command ties up the server and is strictly to be used for
|
||||
debugging purposes.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>limit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Used in conjunction with <parameter>type</parameter> set to
|
||||
cachedump to limit the number of entries to dump.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -86,10 +86,10 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a two-dimensional associative array of server statistics or &false;
|
||||
on failure.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>port</parameter><initializer>11211</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::getServerStatus</function> returns a the servers
|
||||
online/offline status.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This function has been added to Memcache version 2.1.0.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
@@ -40,17 +40,17 @@
|
||||
<varlistentry>
|
||||
<term><parameter>host</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the host where memcached is listening for connections.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the port where memcached is listening for connections.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -58,9 +58,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a the servers status. 0 if server is failed, non-zero otherwise
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>100</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::getStats</function> returns an associative array
|
||||
with server's statistics. Array keys correspond to stats parameters and
|
||||
values to parameter's values.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -37,32 +37,32 @@
|
||||
<varlistentry>
|
||||
<term><parameter>type</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The type of statistics to fetch. Valid values are {reset,
|
||||
malloc, maps, cachedump, slabs, items, sizes}. According to
|
||||
the memcached protocol spec these additional arguments "are
|
||||
subject to change for the convenience of memcache developers".
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>slabid</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Used in conjunction with <parameter>type</parameter> set to
|
||||
cachedump to identify the slab to dump from. The cachedump
|
||||
command ties up the server and is strictly to be used for
|
||||
debugging purposes.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>limit</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Used in conjunction with <parameter>type</parameter> set to
|
||||
cachedump to limit the number of entries to dump.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -70,9 +70,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns an associative array of server statistics&return.falseforfailure;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<methodparam><type>Memcache</type><parameter>memcache</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::getVersion</function> returns a string with server's
|
||||
version number.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a string of server version number&return.falseforfailure;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
<function>Memcache::increment</function> <emphasis>does not</emphasis>
|
||||
create an item if it doesn't already exist.
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
Do not use <function>Memcache::increment</function> with items that have been
|
||||
stored compressed because subsequent calls to
|
||||
<function>Memcache::get</function> will fail.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
|
||||
@@ -45,17 +45,17 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Key of the item to increment.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Increment the item by <parameter>value</parameter>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -63,9 +63,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns new items value on success &return.falseforfailure;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::pconnect</function> is similar to
|
||||
<function>Memcache::connect</function> with the difference, that
|
||||
the connection it establishes is persistent.
|
||||
This connection is not closed after the end of script execution and
|
||||
by <function>Memcache::close</function> function.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -38,31 +38,31 @@
|
||||
<varlistentry>
|
||||
<term><parameter>host</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the host where memcached is listening for connections. This parameter
|
||||
may also specify other transports like <literal>unix:///path/to/memcached.sock</literal>
|
||||
to use UNIX domain sockets, in this case <parameter>port</parameter> must also
|
||||
be set to <literal>0</literal>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the port where memcached is listening for connections. Set this
|
||||
parameter to <literal>0</literal> when using UNIX domain sockets.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Value in seconds which will be used for connecting to the daemon. Think
|
||||
twice before changing the default value of 1 second - you can lose all
|
||||
the advantages of caching if your connection is too slow.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -70,9 +70,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a Memcache object&return.falseforfailure;.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
<methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::replace</function> should be used to replace value of
|
||||
existing item with <parameter>key</parameter>. In case if item with such
|
||||
key doesn't exists, <function>Memcache::replace</function> returns
|
||||
&false;. For the rest <function>Memcache::replace</function> behaves
|
||||
similarly to <function>Memcache::set</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -41,38 +41,38 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The key that will be associated with the item.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>var</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The variable to store. Strings and integers are stored as is, other
|
||||
types are stored serialized.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flag</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Use <constant>MEMCACHE_COMPRESSED</constant> to store the item
|
||||
compressed (uses zlib).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>expire</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Expiration time of the item. If it's equal to zero, the item will never
|
||||
expire. You can also use Unix timestamp or a number of seconds starting
|
||||
from current time, but in the latter case the number of seconds may not
|
||||
exceed 2592000 (30 days).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -80,9 +80,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
<parameter>flag</parameter> value if you want to use on-the-fly
|
||||
compression (uses zlib).
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
Remember that resource variables (i.e. file and connection descriptors)
|
||||
cannot be stored in the cache, because they cannot be adequately
|
||||
represented in serialized state.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</para>
|
||||
|
||||
@@ -52,38 +52,38 @@
|
||||
<varlistentry>
|
||||
<term><parameter>key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The key that will be associated with the item.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>var</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The variable to store. Strings and integers are stored as is, other
|
||||
types are stored serialized.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flag</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Use <constant>MEMCACHE_COMPRESSED</constant> to store the item
|
||||
compressed (uses zlib).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>expire</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Expiration time of the item. If it's equal to zero, the item will never
|
||||
expire. You can also use Unix timestamp or a number of seconds starting
|
||||
from current time, but in the latter case the number of seconds may not
|
||||
exceed 2592000 (30 days).
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -91,9 +91,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
<methodparam choice="opt"><type>float</type><parameter>min_savings</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::setCompressThreshold</function> enables automatic
|
||||
compression of large values.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This function has been added to Memcache version 2.0.0.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
@@ -40,19 +40,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>threshold</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls the minimum value length before attempting to compress automatically.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>min_saving</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Specifies the minimum amount of savings to actually store the value
|
||||
compressed. The supplied value must be between 0 and 1. Default value
|
||||
is 0.2 giving a minimum 20% compression savings.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -60,9 +60,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -29,14 +29,14 @@
|
||||
<methodparam choice="opt"><type>callable</type><parameter>failure_callback</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
<simpara>
|
||||
<function>Memcache::setServerParams</function> changes server parameters at runtime.
|
||||
</para>
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This function has been added to Memcache version 2.1.0.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
@@ -47,61 +47,61 @@
|
||||
<varlistentry>
|
||||
<term><parameter>host</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the host where memcached is listening for connections.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>port</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Point to the port where memcached is listening for connections.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Value in seconds which will be used for connecting to the daemon. Think
|
||||
twice before changing the default value of 1 second - you can lose all
|
||||
the advantages of caching if your connection is too slow.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>retry_interval</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls how often a failed server will be retried, the default value
|
||||
is 15 seconds. Setting this parameter to -1 disables automatic retry.
|
||||
Neither this nor the <parameter>persistent</parameter> parameter has any
|
||||
effect when the extension is loaded dynamically via <function>dl</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>status</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Controls if the server should be flagged as online. Setting this parameter
|
||||
to &false; and <parameter>retry_interval</parameter> to -1 allows a failed
|
||||
server to be kept in the pool so as not to affect the key distribution
|
||||
algorithm. Requests for this server will then failover or fail immediately
|
||||
depending on the <parameter>memcache.allow_failover</parameter> setting.
|
||||
Default to &true;, meaning the server should be considered online.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>failure_callback</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Allows the user to specify a callback function to run upon encountering an
|
||||
error. The callback is run before failover is attempted. The function takes
|
||||
two parameters, the hostname and port of the failed server.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -109,9 +109,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<chapter xml:id="memcache.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="memcache.setup">
|
||||
&reftitle.setup;
|
||||
|
||||
<!-- {{{ Requirements -->
|
||||
<section xml:id="memcache.requirements">
|
||||
&reftitle.required;
|
||||
<para>
|
||||
<simpara>
|
||||
This module uses functions of <link xlink:href="&url.zlib;">zlib</link>
|
||||
to support on-the-fly data compression. Zlib is required to install
|
||||
this module.
|
||||
</para>
|
||||
</simpara>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
@@ -26,15 +25,14 @@
|
||||
<!-- {{{ Resources -->
|
||||
<section xml:id="memcache.resources">
|
||||
&reftitle.resources;
|
||||
<para>
|
||||
<simpara>
|
||||
There is only one resource type used in memcache module - it's
|
||||
the link identifier for a cache server connection.
|
||||
</para>
|
||||
</simpara>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -55,4 +53,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user