Found 1 bookmarks
Newest
MySQLnd Plugins: Writing a MySQL Query Logger in PHP - ThinkPHP /dev/blog
MySQLnd Plugins: Writing a MySQL Query Logger in PHP - ThinkPHP /dev/blog
A new approach to implementing a query logger and potentially more complex features such as monitoring or read/write-splitting is the MySQLnd Userland Handler Extension (mysqlnd_uh, pecl website). The extension lets you register a PHP class as a proxy for every MySQLndconnection. Every call to a function to MySQLnd (usually indirect through mysqli, mysql, pdo_mysql) is passed to the PHP class, which then calls the original MySQLnd function. The extension makes it possible to use a custom userland class as a transparent proxy for all MySQLnd frontend (again mysqli, mysql, pdo_myslq). In the next section, I'll outline the requirements of mysqlnd_uh and show a sample implementation.
MySQLnd Plugins: Writing a MySQL Query Logger in PHP - ThinkPHP /dev/blog