Some rewording, and a few typo fixes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325471 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2012-04-27 05:47:52 +00:00
parent 31ef74909f
commit 001af012d7
5 changed files with 51 additions and 71 deletions

View file

@ -32,12 +32,12 @@
<itemizedlist>
<listitem>
<para>
Queries run by any of the PHP MySQL extensions
Queries executed by any of the PHP MySQL extensions
</para>
</listitem>
<listitem>
<para>
Prepared statements run by any of the PHP MySQL extensions
Prepared statements executing by any of the PHP MySQL extensions
</para>
</listitem>
</itemizedlist>
@ -51,12 +51,12 @@
<itemizedlist>
<listitem>
<para>
Detection of databases uses
Detection of database usage
</para>
</listitem>
<listitem>
<para>
SQL Injection protection using black-/whitelists
SQL injection protection using black and white lists
</para>
</listitem>
</itemizedlist>
@ -79,20 +79,20 @@
</itemizedlist>
</para>
<para>
As of version PHP 5.3.3 the MySQL native driver for PHP
(<literal>mysqlnd</literal>)
The MySQL native driver for PHP (<link linkend="book.mysqlnd">mysqlnd</link>)
features an internal plugin C API. C plugins, such as the mysqlnd
user handler plugin, can extend the functionality of
<link linkend="book.mysqlnd">mysqlnd</link>. PECL/mysqlnd_uh
makes parts of the internal plugin C API available to the
PHP user for plugin development with PHP.
</para>
<para>
The MySQL native driver for PHP is a C library which ships together with
PHP as of PHP 5.3.0. It serves as a drop-in replacement for the
MySQL Client Library (AKA libmysql/libmysqlclient). As of PHP 5.4.0, mysqlnd is
the compile time default library used by all PHP MySQL extensions.
</para>
<note>
<title>Status</title>
<para>
The mysqlnd user handler plugin is in alpha status.
Take appropriate care before using it in production environments.
</para>
</note>
<section xml:id="mysqlnd-uh.security">
<title>Security considerations</title>
@ -116,14 +116,13 @@
<section xml:id="mysqlnd-uh.docs-note">
<title>Documentation note</title>
<para>
Many of the extensions functions are described very briefly.
This is done intentionally to avoid content duplication.
The <link linkend="ref.mysqli">mysqli</link> extension is often
only a thin abstraction layer on top of the MySQL C API, which
Many of the mysqlnd_uh functions are briefly described because
the <link linkend="ref.mysqli">mysqli</link> extension is
a thin abstraction layer on top of the MySQL C API that
the <literal>mysqlnd</literal> library provides. Therefore,
the corresponding <link linkend="ref.mysqli">mysqli</link> documentation
respectively the MySQL reference manual can be consulted
to get more information on a particular function.
(along with the MySQL reference manual) can be consulted
to receive more information about a particular function.
</para>
</section>
@ -131,16 +130,9 @@
<title>On the name</title>
<para>
The shortcut <literal>mysqlnd_uh</literal> stands for
<literal>mysqlnd user handler</literal>. There may be better names.
However, this was the initial choice when development started.
Meanwhile, non speaking names have almost become a tradition.
<literal>mysqlnd user handler</literal>, and has been the name
since early development.
</para>
<note>
<para>
The mysqlnd user handler plugin is in alpha status.
Take appropriate care before using it in production environments.
</para>
</note>
</section>
</preface>

View file

@ -7,12 +7,8 @@
The Change History lists major changes users need to be aware if upgrading
from one version to another. It is a high level summary of selected changes
that may impact applications or might even break backwards compatibility.
Please, consult the <filename>CHANGES</filename> file contained in the source
distribution for a more complete list of changes. If you are eager to learn
about all changes, even smaller ones that do not make it into the
<filename>CHANGES</filename> file, you may want to monitor PECL commit messages.
To do you, you could, for example, subscribe to the PECL commit message mailing
list.
See also the <filename>CHANGES</filename> file contained in the source
for additional changelog information. The commit history is also available.
</para>
<section xml:id="mysqlnd-uh.changes-one-o">

View file

@ -385,7 +385,7 @@
</term>
<listitem>
<simpara>
MySQL Client Server protocol packet: authentification.
MySQL Client Server protocol packet: authentication.
</simpara>
</listitem>
</varlistentry>
@ -529,7 +529,7 @@
</term>
<listitem>
<simpara>
Implicity close, for example, during garbage connection.
Implicitly closed, for example, during garbage connection.
</simpara>
</listitem>
</varlistentry>
@ -619,7 +619,7 @@
</term>
<listitem>
<simpara>
Option: wheter the MySQL compressed protocol is to be used.
Option: whether the MySQL compressed protocol is to be used.
</simpara>
</listitem>
</varlistentry>
@ -696,7 +696,7 @@
</term>
<listitem>
<simpara>
Option: Wheter to allow <literal>LOAD DATA LOCAL INFILE</literal> use.
Option: Whether to allow <literal>LOAD DATA LOCAL INFILE</literal> use.
</simpara>
</listitem>
</varlistentry>
@ -817,7 +817,7 @@
</term>
<listitem>
<simpara>
Option: Wheter to report data truncation.
Option: Whether to report data truncation.
</simpara>
</listitem>
</varlistentry>
@ -828,7 +828,7 @@
</term>
<listitem>
<simpara>
Option: Wheter to reconnect automatically.
Option: Whether to reconnect automatically.
</simpara>
</listitem>
</varlistentry>
@ -949,7 +949,7 @@
</term>
<listitem>
<simpara>
Option: default authentification method.
Option: default authentication method.
</simpara>
</listitem>
</varlistentry>

View file

@ -59,9 +59,9 @@
</term>
<listitem>
<para>
Wheter to report wrong return value types of user hooks as error
of the type <constant>E_WARNING</constant>. It is strongly recommended
to use this setting for detecting possible issues.
Whether to report wrong return value types of user hooks as
<constant>E_WARNING</constant> level errors. This is recommended
for detecting errors.
</para>
</listitem>
</varlistentry>

View file

@ -30,15 +30,15 @@
</para>
<note>
<para>
None of the <literal>mysqlnd</literal> internal function calls has been designed
to ever by exposed to the PHP user. Manipulating their activities may
The internal <literal>mysqlnd</literal> function calls are not designed
to be exposed to the PHP user. Manipulating their activities may
cause PHP to crash or leak memory. Often, this is not considered a bug. Please,
keep in mind that you are accessing C library functions through
PHP which are expected to take certain actions, which you may not be able to
emulate in user space. Therefore, it is strongly recommended to always call
the parent method implementation when subclassing <classname>MysqlndUhConnection</classname>
or <classname>MysqlndUhPreparedStatement</classname>. To prevent the worst
case, the extension performs some sanity checks. Please, see also
case, the extension performs some sanity checks. Please, see also the
<link linkend="mysqlnd-uh.configuration">Mysqlnd_uh &ConfigureOptions;</link>.
</para>
</note>
@ -47,8 +47,7 @@
<section xml:id="mysqlnd-uh.quickstart.configuration">
<title>Setup</title>
<para>
The plugin is implemented as a PHP extension.
Please, follow the
The plugin is implemented as a PHP extension. See the
<link linkend="mysqlnd-uh.installation">installation instructions</link> to
install the
<link xlink:href="&url.pecl.package;mysqlnd_ms">PECL/mysqlnd_uh</link> extension.
@ -73,38 +72,32 @@ mysqlnd_uh.report_wrong_types=1
<section xml:id="mysqlnd-uh.quickstart.how-it-works">
<title>How it works</title>
<para>
<note>
<para>
You can skip the following and move on to the examples for now, if you
are not interested in the inner workings. Please, get back to the
background information and read it carefully, if you plan to use
PECL/mysqlnd_uh intensively in the future.
</para>
</note>
This describes the background and inner workings of the mysqlnd_uh
extension.
</para>
<para>
Two classes are provided by the extension: <classname>MysqlndUhConnection</classname>
and <classname>MysqlndUhPreparedStatement</classname>. The first one lets
and <classname>MysqlndUhPreparedStatement</classname>. <classname>MysqlndUhConnection</classname> lets
you access almost all methods of the <literal>mysqlnd</literal>
internal <literal>connection</literal> class. The latter exposes some, selected
internal <literal>connection</literal> class. The latter exposes some selected
methods of the <literal>mysqlnd</literal> internal <literal>statement</literal> class.
For example, <methodname>MysqlndUhConnection::connect</methodname> maps to
the <literal>mysqlnd</literal> library C function
<literal>mysqlnd_conn__connect</literal>.
</para>
<para>
As a mysqlnd plugin, the PECL/mysqlnd_uh extensions replaces <literal>mysqlnd</literal>
As a mysqlnd plugin, the PECL/mysqlnd_uh extension replaces <literal>mysqlnd</literal>
library C functions with its own functions. Whenever a
PHP MySQL extension compiled to use <literal>mysqlnd</literal>, calls
PHP MySQL extension compiled to use <literal>mysqlnd</literal> calls
a mysqlnd function, the functions installed by the plugin are executed
instead of the original <literal>mysqlnd</literal> ones. If, for example,
instead of the original <literal>mysqlnd</literal> ones. For example,
<function>mysqli_connect</function> invokes <literal>mysqlnd_conn__connect</literal>,
the connect function installed by PECL/mysqlnd_uh will be called.
so the connect function installed by PECL/mysqlnd_uh will be called.
The functions installed by PECL/mysqlnd_uh are the methods of the built-in classes.
</para>
<para>
The built-in PHP classes and their methods do nothing but call their
<literal>mysqlnd</literal> C library counterparts, to behave exaclty
<literal>mysqlnd</literal> C library counterparts, to behave exactly
like the original <literal>mysqlnd</literal> function they replace.
The code below illustrates in pseudo-code what the extension does.
</para>
@ -186,12 +179,11 @@ proxy::connect returns true
By subclassing the classes you can install your own proxy to monitor <literal>mysqlnd</literal>.
</para>
<para>
Please, see <link linkend="mysqlnd-uh.quickstart.how-it-works">How it works</link>
for details. However, to get started you do not need to look at the details.
Copy the patterns shown in the quickstart instead.
See also the <link linkend="mysqlnd-uh.quickstart.how-it-works">How it works</link>
guide to learn about the inner workings of this extension.
</para>
<para>
Connections proxies are objects of the type <classname>MysqlndUhConnection</classname>.
Connection proxies are objects of the type <classname>MysqlndUhConnection</classname>.
Connection proxy objects are installed by
<function>mysqlnd_uh_set_connection_proxy</function>.
If you install the built-in class <classname>MysqlndUhConnection</classname>
@ -213,7 +205,7 @@ $mysqli = new mysqli("localhost", "root", "", "test");
<para>
The <literal>PHP_INI_SYSTEM</literal> configuration setting
<literal><link linkend="ini.mysqlnd-uh.enable">mysqlnd_uh.enable</link></literal>
setting controls whether a proxy may be set. If disabled, the extension
controls whether a proxy may be set. If disabled, the extension
will throw errors of type <literal>E_WARNING</literal>
</para>
<para>
@ -242,7 +234,7 @@ PHP Warning: mysqlnd_uh_set_connection_proxy(): (Mysqlnd User Handler) The plug
</example>
</para>
<para>
To monitor <literal>mysqlnd</literal> you have to write your own
To monitor <literal>mysqlnd</literal>, you have to write your own
proxy object subclassing <classname>MysqlndUhConnection</classname>.
Please, see the function reference for a the list of methods that
can be subclassed. Alternatively, you can use reflection to inspect
@ -340,8 +332,8 @@ stmt_proxy::prepare(SELECT 'mysqlnd hacking made easy' AS _msg FROM DUAL)
Combined with <function>debug_print_backtrace</function> it can become a powerful
tool, for example, to find the origin of certain statement. This may
be desired when searching for slow queries but also after database
refactorings to find code still accessing deprecated databases or
tables. The latter may be a complicated matter to do otherwise, if
refactoring to find code still accessing deprecated databases or
tables. The latter may be a complicated matter to do otherwise, especially if
the application uses auto-generated queries.
</para>
<para>