<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Quickstart and Examples</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intro.mysqlnd-uh.html">Introduction</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqlnd-uh.quickstart.configuration.html">Setup</a></div> <div class="up"><a href="book.mysqlnd-uh.html">mysqlnd_uh</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="mysqlnd-uh.quickstart" class="chapter"> <h1>Quickstart and Examples</h1> <h2>Table of Contents</h2><ul class="chunklist chunklist_chapter"><li><a href="mysqlnd-uh.quickstart.configuration.html">Setup</a></li><li><a href="mysqlnd-uh.quickstart.how-it-works.html">How it works</a></li><li><a href="mysqlnd-uh.quickstart.proxy-installation.html">Installing a proxy</a></li><li><a href="mysqlnd-uh.quickstart.query-monitoring.html">Basic query monitoring</a></li></ul> <p class="para"> The mysqlnd user handler plugin can be understood as a client-side proxy for all PHP MySQL extensions (<a href="ref.mysqli.html" class="link">mysqli</a>, <a href="ref.mysql.html" class="link">mysql</a>, <a href="ref.pdo-mysql.html" class="link">PDO_MYSQL</a>), if they are compiled to use the <a href="book.mysqlnd.html" class="link">mysqlnd</a> library. The extensions use the <em>mysqlnd</em> library internally, at the C level, to communicate with the MySQL server. PECL/mysqlnd_uh allows it to hook many <em>mysqlnd</em> calls. Therefore, most activities of the PHP MySQL extensions can be monitored. </p> <p class="para"> Because monitoring happens at the level of the library, at a layer below the application, it is possible to monitor applications without changing them. </p> <p class="para"> On the C level, the <em>mysqlnd</em> library is structured in modules or classes. The extension hooks almost all methods of the <em>mysqlnd</em> internal <em>connection</em> class and exposes them through the user space class <a href="class.mysqlnduhconnection.html" class="classname">MysqlndUhConnection</a>. Some few methods of the mysqlnd internal <em>statement</em> class are made available to the PHP user with the class <a href="class.mysqlnduhpreparedstatement.html" class="classname">MysqlndUhPreparedStatement</a>. By subclassing the classes <a href="class.mysqlnduhconnection.html" class="classname">MysqlndUhConnection</a> and <a href="class.mysqlnduhpreparedstatement.html" class="classname">MysqlndUhPreparedStatement</a> users get access to <em>mysqlnd</em> internal function calls. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> The internal <em>mysqlnd</em> 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 <a href="class.mysqlnduhconnection.html" class="classname">MysqlndUhConnection</a> or <a href="class.mysqlnduhpreparedstatement.html" class="classname">MysqlndUhPreparedStatement</a>. To prevent the worst case, the extension performs some sanity checks. Please, see also the <a href="mysqlnd-uh.configuration.html" class="link">Mysqlnd_uh Configure Options</a>. </p> </p></blockquote> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intro.mysqlnd-uh.html">Introduction</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqlnd-uh.quickstart.configuration.html">Setup</a></div> <div class="up"><a href="book.mysqlnd-uh.html">mysqlnd_uh</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>