Chapter 9 Mysqlnd user handler plugin (mysqlnd_uh)

Table of Contents

9.1 Security considerations
9.2 Documentation note
9.3 On the name
9.4 Quickstart and Examples
9.4.1 Setup
9.4.2 How it works
9.4.3 Installing a proxy
9.4.4 Basic query monitoring
9.5 Installing/Configuring
9.5.1 Requirements
9.5.2 Installation
9.5.3 Runtime Configuration
9.5.4 Resource Types
9.6 Predefined Constants
9.7 The MysqlndUhConnection class (MysqlndUhConnection)
9.7.1 MysqlndUhConnection::changeUser
9.7.2 MysqlndUhConnection::charsetName
9.7.3 MysqlndUhConnection::close
9.7.4 MysqlndUhConnection::connect
9.7.5 MysqlndUhConnection::__construct
9.7.6 MysqlndUhConnection::endPSession
9.7.7 MysqlndUhConnection::escapeString
9.7.8 MysqlndUhConnection::getAffectedRows
9.7.9 MysqlndUhConnection::getErrorNumber
9.7.10 MysqlndUhConnection::getErrorString
9.7.11 MysqlndUhConnection::getFieldCount
9.7.12 MysqlndUhConnection::getHostInformation
9.7.13 MysqlndUhConnection::getLastInsertId
9.7.14 MysqlndUhConnection::getLastMessage
9.7.15 MysqlndUhConnection::getProtocolInformation
9.7.16 MysqlndUhConnection::getServerInformation
9.7.17 MysqlndUhConnection::getServerStatistics
9.7.18 MysqlndUhConnection::getServerVersion
9.7.19 MysqlndUhConnection::getSqlstate
9.7.20 MysqlndUhConnection::getStatistics
9.7.21 MysqlndUhConnection::getThreadId
9.7.22 MysqlndUhConnection::getWarningCount
9.7.23 MysqlndUhConnection::init
9.7.24 MysqlndUhConnection::killConnection
9.7.25 MysqlndUhConnection::listFields
9.7.26 MysqlndUhConnection::listMethod
9.7.27 MysqlndUhConnection::moreResults
9.7.28 MysqlndUhConnection::nextResult
9.7.29 MysqlndUhConnection::ping
9.7.30 MysqlndUhConnection::query
9.7.31 MysqlndUhConnection::queryReadResultsetHeader
9.7.32 MysqlndUhConnection::reapQuery
9.7.33 MysqlndUhConnection::refreshServer
9.7.34 MysqlndUhConnection::restartPSession
9.7.35 MysqlndUhConnection::selectDb
9.7.36 MysqlndUhConnection::sendClose
9.7.37 MysqlndUhConnection::sendQuery
9.7.38 MysqlndUhConnection::serverDumpDebugInformation
9.7.39 MysqlndUhConnection::setAutocommit
9.7.40 MysqlndUhConnection::setCharset
9.7.41 MysqlndUhConnection::setClientOption
9.7.42 MysqlndUhConnection::setServerOption
9.7.43 MysqlndUhConnection::shutdownServer
9.7.44 MysqlndUhConnection::simpleCommand
9.7.45 MysqlndUhConnection::simpleCommandHandleResponse
9.7.46 MysqlndUhConnection::sslSet
9.7.47 MysqlndUhConnection::stmtInit
9.7.48 MysqlndUhConnection::storeResult
9.7.49 MysqlndUhConnection::txCommit
9.7.50 MysqlndUhConnection::txRollback
9.7.51 MysqlndUhConnection::useResult
9.8 The MysqlndUhPreparedStatement class (MysqlndUhPreparedStatement)
9.8.1 MysqlndUhPreparedStatement::__construct
9.8.2 MysqlndUhPreparedStatement::execute
9.8.3 MysqlndUhPreparedStatement::prepare
9.9 Mysqlnd_uh Functions
9.9.1 mysqlnd_uh_convert_to_mysqlnd
9.9.2 mysqlnd_uh_set_connection_proxy
9.9.3 mysqlnd_uh_set_statement_proxy
9.10 Change History
9.10.1 PECL/mysqlnd_uh 1.0 series

Copyright 1997-2014 the PHP Documentation Group.

The mysqlnd user handler plugin (mysqlnd_uh) allows users to set hooks for most internal calls of the MySQL native driver for PHP (mysqlnd). Mysqlnd and its plugins, including PECL/mysqlnd_uh, operate on a layer beneath the PHP MySQL extensions. A mysqlnd plugin can be considered as a proxy between the PHP MySQL extensions and the MySQL server as part of the PHP executable on the client-side. Because the plugins operates on their own layer below the PHP MySQL extensions, they can monitor and change application actions without requiring application changes. If the PHP MySQL extensions (mysqli, mysql, PDO_MYSQL) are compiled to use mysqlnd this can be used for:

The MySQL native driver for PHP (mysqlnd) features an internal plugin C API. C plugins, such as the mysqlnd user handler plugin, can extend the functionality of mysqlnd. PECL/mysqlnd_uh makes parts of the internal plugin C API available to the PHP user for plugin development with PHP.

Status

The mysqlnd user handler plugin is in alpha status. Take appropriate care before using it in production environments.