Proposing MySQLnd Userland Handler
| From: | David Soria Parra | Date: | Fri, 06 Aug 2010 19:11:26 +0000 |
| Subject: | Proposing MySQLnd Userland Handler | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-7415@lists.php.net to get a copy of this message | ||
Hi DevML,
I would like to propose the pecl extension "MySQLnd Userland Handler" (mysqlnd_uh).
The plugin let you hook a mysqli connection if you use mysqlnd and install a userland proxy class
for every call. This allows you to write SQL monitoring tools in PHP Userland. It works with PHP
5.3.0
and a first version will be marked as 0.1.0 alpha.
The code can be found at: http://patches.experimentalworks.net/mysqlnd_uh.tar.bz2
A short example:
<?php
/* print every mysqlnd query to stdout */
class Proxy extends MySQLndUHConnection {
public function query ($res, $query) {
fprintf(STDERR, "Query: " . $query);
}
}
mysqlnd_uh_set_connection_proxy(new Proxy());
?>
If there are no objections I'll import the project to the pecl SVN and create a package.
Greetings
David