Tweaked docs. Some fixes, and rewording.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328622 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2012-12-03 08:51:30 +00:00
parent e94533ab35
commit 8dd31a0b4e
6 changed files with 79 additions and 98 deletions

View file

@ -17,13 +17,12 @@
</term>
<listitem>
<simpara>
Default regular expression (pcre style) used for matching <literal>SELECT</literal>
statements that shall be mapped into a MySQL Memcache Plugin
access, if possible.
Default regular expression (PCRE style) used for matching <literal>SELECT</literal>
statements that will be mapped into a MySQL Memcache Plugin access point, if possible.
</simpara>
<simpara>
It is possible to use a different but the defailt regular expression for pattern
matching. See also <function>mysqlnd_memcache_set</function>.
It is also possible to use <function>mysqlnd_memcache_set</function>, but the default
approach is using this regular expression for pattern matching.
</simpara>
</listitem>
</varlistentry>
@ -34,7 +33,7 @@
<emphasis role="bold">Assorted</emphasis>
</para>
<para>
The plugins version number can be obtained using
The version number of this plugin can be obtained by using
<constant>MYSQLND_MEMCACHE_VERSION</constant> or
<constant>MYSQLND_MEMCACHE_VERSION_ID</constant>.
<constant>MYSQLND_MEMCACHE_VERSION</constant>

View file

@ -15,11 +15,11 @@
<methodparam><type>mixed</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
This function returns an array containing all the mysqlnd_memcache related
configuration attached to a MySQL connection. This includes MySQL the
Memcache object provided via <function>mysqlnd_memcache_set</function>
as well as the table mapping configuration which was automatically collected
from the MySQL server.
This function returns an array of all mysqlnd_memcache related configuration
information that is attached to the MySQL connection. This includes MySQL, the
Memcache object provided via <function>mysqlnd_memcache_set</function>,
and the table mapping configuration that was automatically collected
from the MySQL Server.
</para>
</refsect1>
@ -30,10 +30,9 @@
<term><parameter>connection</parameter></term>
<listitem>
<para>
A handle to a MySQL server of the type
A handle to a MySQL Server using one of the MySQL API extensions for PHP, which are
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>, <link linkend="book.mysqli">mysqli</link> or
<link linkend="book.mysql">ext/mysql</link> for which the configuration is to
be returned.
<link linkend="book.mysql">ext/mysql</link>.
</para>
</listitem>
</varlistentry>
@ -43,15 +42,14 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the connection is associated with a memcache connection an array will
be returned. Otherwise this function will return <literal>false</literal>.
An array of mysqlnd_memcache configuration information on success, otherwise &false;.
</para>
<para>
The returned array has these elements:
</para>
<para>
<table>
<title>mysqlnd_memcache_get_config array structure</title>
<title><function>mysqlnd_memcache_get_config</function> array structure</title>
<tgroup cols="2">
<thead>
<row>
@ -65,20 +63,20 @@
<entry>
Instance of Memcached associated to this MySQL connection
by <methodname>mysqlnd_memcache_set</methodname>. You can use this to
change settings of the memcache connection or directly querying the
server onthis connection.
change settings of the memcache connection, or directly by querying the
server on this connection.
</entry>
</row>
<row>
<entry>pattern</entry>
<entry>
Regular expression used to match an SQL query being sent to the server.
The PCRE regular expression used to match the SQL query sent to the server.
Queries matching this pattern will be further analyzed to decide whether
the query can be intercepted and sent via the memcache interface or
whether the query is sent using the general MySQL protocol to the
server. The pattern either is the default pattern,
<literal>MYSQLND_MEMCACHE_DEFAULT_REGEXP</literal> or set via
<methodname>mysqlnd_memcache_set</methodname>.
server. The pattern is either the default pattern
(<literal>MYSQLND_MEMCACHE_DEFAULT_REGEXP</literal>) or it is set via
<function>mysqlnd_memcache_set</function>.
</entry>
</row>
<row>
@ -88,7 +86,7 @@
were discovered by this plugin. The key for these elements is the name
of the container in the MySQL configuration. The value is described
below. The contents of this field is created by querying the MySQL
server during associting a MySQL and a memcache connection using
Server during association to MySQL and a memcache connection using
<methodname>mysqlnd_memcache_set</methodname>.
</entry>
</row>
@ -117,7 +115,7 @@
<entry>prefix</entry>
<entry>
A prefix used while accessing data via memcache. With the MySQL InnoDB
Memcache Deamon plugin this usully begins with @@ and ends with a
Memcache Deamon plugin, this usually begins with @@ and ends with a
configurable separator. This prefix is placed in front of the key value
while using the memcache protocol.
</entry>
@ -131,7 +129,7 @@
<row>
<entry>table_name</entry>
<entry>
Name of the table which contins the data accessible via memcache
Name of the table which contains the data accessible via memcache
protocol.
</entry>
</row>
@ -139,21 +137,21 @@
<entry>id_field_name</entry>
<entry>
Name of the database field (column) with the id used as key when
accessing the table vi a memcache. Often this is the database field
accessing the table via memcache. Often this is the database field
having a primary key.
</entry>
</row>
<row>
<entry>separator</entry>
<entry>
A seprator used to split different field values. This is needed as
The separator used to split the different field values. This is needed as
memcache only provides access to a single value while MySQL can map
multiple columns to this value.
<note>
<para>
The separator, which can be set in the MySQL Server configuration
should not be part ofany value retrieved via memcache as proper
mapping can't be guranteed.
The separator, which can be set in the MySQL Server configuration,
should not be part of any value retrieved via memcache because proper
mapping can't be guaranteed.
</para>
</note>
</entry>
@ -161,7 +159,7 @@
<row>
<entry>fields</entry>
<entry>
An array with the names of all fields availle forthis mapping.
An array with the name of all fields available for this mapping.
</entry>
</row>
</tbody>

View file

@ -20,12 +20,12 @@
<para>
Associate <parameter>mysql_connection</parameter> with
<parameter>memcache_connection</parameter> using <parameter>pattern</parameter>
as decision Regexp and <parameter>callback</parameter> as notification
callback or unset the association of <parameter>mysql_connection</parameter>.
as a PCRE regular expression, and <parameter>callback</parameter> as a notification
callback or to unset the association of <parameter>mysql_connection</parameter>.
</para>
<para>
While associating a MySQL connection with a Memcache connection this function
will query the MySQL server for its configuration. It will automatically
While associating a MySQL connection with a Memcache connection, this function
will query the MySQL Server for its configuration. It will automatically
detect whether the server is configured to use the InnoDB Memcache Daemon
Plugin or MySQL Cluster NDB Memcache support. It will also query the server
to automatically identify exported tables and other configuration options.
@ -41,10 +41,9 @@
<term><parameter>mysql_connection</parameter></term>
<listitem>
<para>
A handle to a MySQL server of the type
A handle to a MySQL Server using one of the MySQL API extensions for PHP, which are
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>, <link linkend="book.mysqli">mysqli</link> or
<link linkend="book.mysql">ext/mysql</link> for which the configuration is to
be set.
<link linkend="book.mysql">ext/mysql</link>.
</para>
</listitem>
</varlistentry>
@ -52,10 +51,10 @@
<term><parameter>memcache_connection</parameter></term>
<listitem>
<para>
A <link linkend="book.memcached">Memcached</link> instance with an
A <link linkend="book.memcached">Memcached</link> instance with a
connection to the MySQL Memcache Daemon plugin. If this parameter
is ommitted <parameter>mysql_connection</parameter> will be unassociated
from any memcache connection. If a previous association exists it will be
is omitted, then <parameter>mysql_connection</parameter> will be unassociated
from any memcache connection. And if a previous association exists, then it will be
replaced.
</para>
</listitem>
@ -69,7 +68,7 @@
Memcache-queries. The query should have three sub patterns. The
first subpattern contains the requested field list, the second the name
of the ID column from the query and the third the requested value. If
this parameteris ommitted or set to &null; a default
this parameter is omitted or os set to &null;, then a default
pattern will be used.
</para>
</listitem>
@ -90,8 +89,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the association or disassociation succeds the function returns &true;. In
case of an error &false; is being returned.
&true; if the association or disassociation is successful, otherwise &false; if there
is an error.
</para>
</refsect1>
@ -101,7 +100,7 @@
<example>
<title>
<function>mysqlnd_memcache_set</function> example with
<function>var_dump</function> as simple debugging callabck.</title>
<function>var_dump</function> as a simple debugging callback.</title>
<programlisting role="php">
<![CDATA[

View file

@ -20,8 +20,8 @@
<row>
<entry><link linkend="ini.mysqlnd-memcache.enable">mysqlnd_memcache.enable</link></entry>
<entry>1</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
<entry><constant>PHP_INI_SYSTEM</constant></entry>
<entry>Available since 1.0.0</entry>
</row>
</tbody>
</tgroup>
@ -46,10 +46,10 @@
<link linkend="book.mysqlnd">mysqlnd</link> C API calls.
<note>
<para>
This option is mostly meant to be used by developers building this
extension static into PHP. In general users are encouraged to build
this extension as shared object and unloading it completely if not
needed.
This option is mainly used by developers to build this
extension statically into PHP. General users are encouraged to build
this extension as a shared object, and to unload it completely when
it is not needed.
</para>
</note>
</para>

View file

@ -20,22 +20,14 @@
<para>
The plugin is implemented as a PHP extension. See also the
<link linkend="mysqlnd-memcache.installation">installation instructions</link> to
install the
<link xlink:href="&url.pecl.package;mysqlnd_memcache">mysqlnd_memcache</link> extension.
install this extension.
</para>
<para>
Compile or configure the PHP MySQL extension (API) (<link linkend="ref.mysqli">mysqli</link>,
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>,
<link linkend="ref.mysql">mysql</link>) that you plan to use with support
for the <link linkend="book.mysqlnd">mysqlnd</link> library. mysqlnd_memcache
is a plugin for the mysqlnd library. To use the plugin with any of the PHP
MySQL extensions, the extension has to use the mysqlnd library.
</para>
<para>
The mysqlnd_memcche PHP extension depends on the
<link linkend="book.memcached">memcached</link> extension. Refer to the
according <link linkend="memcached.installation">installation
instructions</link> for installing that module.
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>, <link linkend="ref.mysql">mysql</link>).
That extension must use the <link linkend="book.mysqlnd">mysqlnd</link> library as
because mysqlnd_memcache is a plugin for the mysqlnd library. For additional information,
refer to the <link linkend="memcached.installation">mysqlnd_memcache installation instructions</link>.
</para>
<para>
Then, load this extension into PHP and activate the plugin in the PHP configuration
@ -48,20 +40,22 @@
<programlisting role="ini">
<![CDATA[
; On Windows the filename is php_mysqnd_memcache.dll
; Load the extension
extension=mysqlnd_memcache.so
; Enable it
mysqlnd_memcache.enable=1
]]>
</programlisting>
</example>
</para>
<para>
Follow the instructions given in the MySQL Reference Manual on installing
the Memcache plugins for the MySQL server. Activate the plugins and
configure the Memcache access to SQL tables.
Follow the instructions given in the <link xlink:href="&url.mysql.docs.memcached;">MySQL
Reference Manual on installing the Memcache plugins</link> for the MySQL server. Activate
the plugins and configure Memcache access for SQL tables.
</para>
<para>
For all future examples it is assumed that you have created a SQL table
like the following and configured Memcache access to it.
The examples in this quickguide assume that the following table exists, and that
Memcache is configured with access to it.
</para>
<para>
<example>
@ -126,8 +120,8 @@ mysqlnd_memcache_set($mysqli, $memc);
/*
This is a query which queries table test using id as key in the WHERE part
and is accessing fields f1, f2 and f3. Therefore mysqlnd_memcache
will intercept it and route it ia memcache.
and is accessing fields f1, f2 and f3. Therefore, mysqlnd_memcache
will intercept it and route it via memcache.
*/
$result = $mysqli->query("SELECT f1, f2, f3 FROM test WHERE id = 1");
while ($row = $result->fetch_row()) {
@ -136,7 +130,7 @@ while ($row = $result->fetch_row()) {
/*
This is a query which queries table test but using f1 in the WHERE clause.
Therefore mysqlnd_memcache can't intercept it. This will be executed
Therefore, mysqlnd_memcache can't intercept it. This will be executed
using the MySQL protocol
*/
$mysqli->query("SELECT id FROM test WHERE f1 = 'Lady'");

View file

@ -7,37 +7,28 @@
<section xml:id="mysqlnd-memcache.requirements">
&reftitle.required;
<para>
This extension requires <literal>PHP 5.4.4</literal> or newer.
PHP: this extension requires PHP 5.4+, version PHP 5.4.4 or never. The required
PHP extensions are <link linkend="ref.pcre">PCRE</link> (enabled by default), and
the <link linkend="book.memcached">memcached</link> extension version 2.0.x.
</para>
<para>
For accessing <literal>InnoDB</literal> tables this PHP extension requires
<literal>MySQL Server 5.6.6</literal> or newer with the InnoDB Memcache
Daemon Plugin.
</para>
<para>
For accessing <literal>MySQL Cluster NDB</literal> tables this PHP extensions
requires <literal>MySQL Cluster 7.2</literal> or newer with configured NDB
Memcache API nodes.
</para>
<para>
<literal>PHP</literal> must be compiled with support for Perl regular
expressions through the <link linkend="ref.pcre">pcre</link> extension.
PCRE is included into PHP by default.
</para>
<para>
The <link linkend="book.memcached">memcached</link> extension 2.0.x
must be loaded into <literal>PHP</literal>.
</para>
<para>
The <literal>mysqlnd_memcache</literal> memcache
The <literal>mysqlnd_memcache</literal> Memcache
plugin supports all PHP applications and all available PHP MySQL extensions
(<link linkend="ref.mysqli">mysqli</link>,
<link linkend="ref.mysql">mysql</link>,
<link linkend="ref.pdo-mysql">PDO_MYSQL</link>).
The PHP MySQL extension must be configured to use
<link linkend="book.mysqlnd">mysqlnd</link> in order to be able
to use the <literal>mysqlnd_memcache</literal> plugin for
<link linkend="book.mysqlnd">mysqlnd</link>.
The PHP MySQL extension must be configured with
<link linkend="book.mysqlnd">mysqlnd</link> support.
</para>
<para>
For accessing <literal>InnoDB</literal> tables, this PHP extension requires
<literal>MySQL Server 5.6.6</literal> or newer with the InnoDB Memcache
Daemon Plugin enabled.
</para>
<para>
For accessing <literal>MySQL Cluster NDB</literal> tables, this PHP extension requires
<literal>MySQL Cluster 7.2</literal> or newer with the NDB Memcache API nodes
enabled.
</para>
</section>