Предопределенные константы
Перечисленные ниже константы определены данным расширением и могут быть доступны только в том случае, если PHP был собран с поддержкой этого расширения или же в том случае, если данное расширение было подгружено во время выполнения.
Most of the constants refer to details of the MySQL Client Server Protocol. Please, refer to the MySQL reference manual to learn about their meaning. To avoid content duplication, only short descriptions are given.
MysqlndUhConnection::simpleCommand() related
The following constants can be used to detect what command is to be send through MysqlndUhConnection::simpleCommand().
-
MYSQLND_UH_MYSQLND_COM_SLEEP
(int) - MySQL Client Server protocol command: COM_SLEEP.
-
MYSQLND_UH_MYSQLND_COM_QUIT
(int) - MySQL Client Server protocol command: COM_QUIT.
-
MYSQLND_UH_MYSQLND_COM_INIT_DB
(int) - MySQL Client Server protocol command: COM_INIT_DB.
-
MYSQLND_UH_MYSQLND_COM_QUERY
(int) - MySQL Client Server protocol command: COM_QUERY.
-
MYSQLND_UH_MYSQLND_COM_FIELD_LIST
(int) - MySQL Client Server protocol command: COM_FIELD_LIST.
-
MYSQLND_UH_MYSQLND_COM_CREATE_DB
(int) - MySQL Client Server protocol command: COM_CREATE_DB.
-
MYSQLND_UH_MYSQLND_COM_DROP_DB
(int) - MySQL Client Server protocol command: COM_DROP_DB.
-
MYSQLND_UH_MYSQLND_COM_REFRESH
(int) - MySQL Client Server protocol command: COM_REFRESH.
-
MYSQLND_UH_MYSQLND_COM_SHUTDOWN
(int) - MySQL Client Server protocol command: COM_SHUTDOWN.
-
MYSQLND_UH_MYSQLND_COM_STATISTICS
(int) - MySQL Client Server protocol command: COM_STATISTICS.
-
MYSQLND_UH_MYSQLND_COM_PROCESS_INFO
(int) - MySQL Client Server protocol command: COM_PROCESS_INFO.
-
MYSQLND_UH_MYSQLND_COM_CONNECT
(int) - MySQL Client Server protocol command: COM_CONNECT.
-
MYSQLND_UH_MYSQLND_COM_PROCESS_KILL
(int) - MySQL Client Server protocol command: COM_PROCESS_KILL.
-
MYSQLND_UH_MYSQLND_COM_DEBUG
(int) - MySQL Client Server protocol command: COM_DEBUG.
-
MYSQLND_UH_MYSQLND_COM_PING
(int) - MySQL Client Server protocol command: COM_PING.
-
MYSQLND_UH_MYSQLND_COM_TIME
(int) - MySQL Client Server protocol command: COM_TIME.
-
MYSQLND_UH_MYSQLND_COM_DELAYED_INSERT
(int) - MySQL Client Server protocol command: COM_DELAYED_INSERT.
-
MYSQLND_UH_MYSQLND_COM_CHANGE_USER
(int) - MySQL Client Server protocol command: COM_CHANGE_USER.
-
MYSQLND_UH_MYSQLND_COM_BINLOG_DUMP
(int) - MySQL Client Server protocol command: COM_BINLOG_DUMP.
-
MYSQLND_UH_MYSQLND_COM_TABLE_DUMP
(int) - MySQL Client Server protocol command: COM_TABLE_DUMP.
-
MYSQLND_UH_MYSQLND_COM_CONNECT_OUT
(int) - MySQL Client Server protocol command: COM_CONNECT_OUT.
-
MYSQLND_UH_MYSQLND_COM_REGISTER_SLAVED
(int) - MySQL Client Server protocol command: COM_REGISTER_SLAVED.
-
MYSQLND_UH_MYSQLND_COM_STMT_PREPARE
(int) - MySQL Client Server protocol command: COM_STMT_PREPARE.
-
MYSQLND_UH_MYSQLND_COM_STMT_EXECUTE
(int) - MySQL Client Server protocol command: COM_STMT_EXECUTE.
-
MYSQLND_UH_MYSQLND_COM_STMT_SEND_LONG_DATA
(int) - MySQL Client Server protocol command: COM_STMT_SEND_LONG_DATA.
-
MYSQLND_UH_MYSQLND_COM_STMT_CLOSE
(int) - MySQL Client Server protocol command: COM_STMT_CLOSE.
-
MYSQLND_UH_MYSQLND_COM_STMT_RESET
(int) - MySQL Client Server protocol command: COM_STMT_RESET.
-
MYSQLND_UH_MYSQLND_COM_SET_OPTION
(int) - MySQL Client Server protocol command: COM_SET_OPTION.
-
MYSQLND_UH_MYSQLND_COM_STMT_FETCH
(int) - MySQL Client Server protocol command: COM_STMT_FETCH.
-
MYSQLND_UH_MYSQLND_COM_DAEMON
(int) - MySQL Client Server protocol command: COM_DAEMON.
-
MYSQLND_UH_MYSQLND_COM_END
(int) - MySQL Client Server protocol command: COM_END.
The following constants can be used to analyze the ok_packet
argument of MysqlndUhConnection::simpleCommand().
-
MYSQLND_UH_MYSQLND_PROT_GREET_PACKET
(int) - MySQL Client Server protocol packet: greeting.
-
MYSQLND_UH_MYSQLND_PROT_AUTH_PACKET
(int) - MySQL Client Server protocol packet: authentication.
-
MYSQLND_UH_MYSQLND_PROT_OK_PACKET
(int) - MySQL Client Server protocol packet: OK.
-
MYSQLND_UH_MYSQLND_PROT_EOF_PACKET
(int) - MySQL Client Server protocol packet: EOF.
-
MYSQLND_UH_MYSQLND_PROT_CMD_PACKET
(int) - MySQL Client Server protocol packet: command.
-
MYSQLND_UH_MYSQLND_PROT_RSET_HEADER_PACKET
(int) - MySQL Client Server protocol packet: result set header.
-
MYSQLND_UH_MYSQLND_PROT_RSET_FLD_PACKET
(int) - MySQL Client Server protocol packet: resultset field.
-
MYSQLND_UH_MYSQLND_PROT_ROW_PACKET
(int) - MySQL Client Server protocol packet: row.
-
MYSQLND_UH_MYSQLND_PROT_STATS_PACKET
(int) - MySQL Client Server protocol packet: stats.
-
MYSQLND_UH_MYSQLND_PREPARE_RESP_PACKET
(int) - MySQL Client Server protocol packet: prepare response.
-
MYSQLND_UH_MYSQLND_CHG_USER_RESP_PACKET
(int) - MySQL Client Server protocol packet: change user response.
-
MYSQLND_UH_MYSQLND_PROT_LAST
(int) - No practical meaning. Last entry marker of internal C data structure list.
MysqlndUhConnection::close() related
The following constants can be used to detect why a connection has been
closed through MysqlndUhConnection::close()
.
-
MYSQLND_UH_MYSQLND_CLOSE_EXPLICIT
(int) - User has called mysqlnd to close the connection.
-
MYSQLND_UH_MYSQLND_CLOSE_IMPLICIT
(int) - Implicitly closed, for example, during garbage connection.
-
MYSQLND_UH_MYSQLND_CLOSE_DISCONNECTED
(int) - Connection error.
-
MYSQLND_UH_MYSQLND_CLOSE_LAST
(int) - No practical meaning. Last entry marker of internal C data structure list.
MysqlndUhConnection::setServerOption() related
The following constants can be used to detect which option is set through
MysqlndUhConnection::setServerOption()
.
-
MYSQLND_UH_SERVER_OPTION_MULTI_STATEMENTS_ON
(int) - Option: enables multi statement support.
-
MYSQLND_UH_SERVER_OPTION_MULTI_STATEMENTS_OFF
(int) - Option: disables multi statement support.
MysqlndUhConnection::setClientOption() related
The following constants can be used to detect which option is set through MysqlndUhConnection::setClientOption().
-
MYSQLND_UH_MYSQLND_OPTION_OPT_CONNECT_TIMEOUT
(int) - Option: connection timeout.
-
MYSQLND_UH_MYSQLND_OPTION_OPT_COMPRESS
(int) - Option: whether the MySQL compressed protocol is to be used.
-
MYSQLND_UH_MYSQLND_OPTION_OPT_NAMED_PIPE
(int) - Option: named pipe to use for connection (Windows).
-
MYSQLND_UH_MYSQLND_OPTION_INIT_COMMAND
(int) - Option: init command to execute upon connect.
-
MYSQLND_UH_MYSQLND_READ_DEFAULT_FILE
(int) - Option: MySQL server default file to read upon connect.
-
MYSQLND_UH_MYSQLND_READ_DEFAULT_GROUP
(int) - Option: MySQL server default file group to read upon connect.
-
MYSQLND_UH_MYSQLND_SET_CHARSET_DIR
(int) - Option: charset description files directory.
-
MYSQLND_UH_MYSQLND_SET_CHARSET_NAME
(int) - Option: charset name.
-
MYSQLND_UH_MYSQLND_OPT_LOCAL_INFILE
(int) -
Option: Whether to allow
LOAD DATA LOCAL INFILE
use. -
MYSQLND_UH_MYSQLND_OPT_PROTOCOL
(int) - Option: supported protocol version.
- Option: shared memory base name for shared memory connections.
-
MYSQLND_UH_MYSQLND_OPT_READ_TIMEOUT
(int) - Option: connection read timeout.
-
MYSQLND_UH_MYSQLND_OPT_WRITE_TIMEOUT
(int) - Option: connection write timeout.
-
MYSQLND_UH_MYSQLND_OPT_USE_RESULT
(int) - Option: unbuffered result sets.
-
MYSQLND_UH_MYSQLND_OPT_USE_REMOTE_CONNECTION
(int) - Embedded server related.
-
MYSQLND_UH_MYSQLND_OPT_USE_EMBEDDED_CONNECTION
(int) - Embedded server related.
-
MYSQLND_UH_MYSQLND_OPT_GUESS_CONNECTION
(int) - TODO
-
MYSQLND_UH_MYSQLND_SET_CLIENT_IP
(int) - TODO
-
MYSQLND_UH_MYSQLND_SECURE_AUTH
(int) - TODO
-
MYSQLND_UH_MYSQLND_REPORT_DATA_TRUNCATION
(int) - Option: Whether to report data truncation.
-
MYSQLND_UH_MYSQLND_OPT_RECONNECT
(int) - Option: Whether to reconnect automatically.
-
MYSQLND_UH_MYSQLND_OPT_SSL_VERIFY_SERVER_CERT
(int) - Option: TODO
-
MYSQLND_UH_MYSQLND_OPT_NET_CMD_BUFFER_SIZE
(int) - Option: mysqlnd network buffer size for commands.
-
MYSQLND_UH_MYSQLND_OPT_NET_READ_BUFFER_SIZE
(int) - Option: mysqlnd network buffer size for reading from the server.
-
MYSQLND_UH_MYSQLND_OPT_SSL_KEY
(int) - Option: SSL key.
-
MYSQLND_UH_MYSQLND_OPT_SSL_CERT
(int) - Option: SSL certificate.
-
MYSQLND_UH_MYSQLND_OPT_SSL_CA
(int) - Option: SSL CA.
-
MYSQLND_UH_MYSQLND_OPT_SSL_CAPATH
(int) - Option: Path to SSL CA.
-
MYSQLND_UH_MYSQLND_OPT_SSL_CIPHER
(int) - Option: SSL cipher.
-
MYSQLND_UH_MYSQLND_OPT_SSL_PASSPHRASE
(int) - Option: SSL passphrase.
-
MYSQLND_UH_SERVER_OPTION_PLUGIN_DIR
(int) - Option: server plugin directory.
-
MYSQLND_UH_SERVER_OPTION_DEFAULT_AUTH
(int) - Option: default authentication method.
-
MYSQLND_UH_SERVER_OPTION_SET_CLIENT_IP
(int) - TODO
-
MYSQLND_UH_MYSQLND_OPT_MAX_ALLOWED_PACKET
(int) -
Option: maximum allowed packet size. Available as of
PHP 5.4.0
. -
MYSQLND_UH_MYSQLND_OPT_AUTH_PROTOCOL
(int) -
Option: TODO. Available as of
PHP 5.4.0
. -
MYSQLND_UH_MYSQLND_OPT_INT_AND_FLOAT_NATIVE
(int) - Option: make mysqlnd return integer and float columns as long even when using the MySQL Client Server text protocol. Only available with a custom build of mysqlnd.
Other
The plugins version number can be obtained using
MYSQLND_UH_VERSION
or
MYSQLND_UH_VERSION_ID
.
MYSQLND_UH_VERSION
is the string representation of the numerical version number
MYSQLND_UH_VERSION_ID
, which is an integer such as 10000.
Developers can calculate the version number as follows.
Version (part) | Example |
---|---|
Major*10000 | 1*10000 = 10000 |
Minor*100 | 0*100 = 0 |
Patch | 0 = 0 |
MYSQLND_UH_VERSION_ID |
10000 |
-
MYSQLND_UH_VERSION
(string) -
Plugin version string, for example,
1.0.0-alpha
. -
MYSQLND_UH_VERSION_ID
(int) - Plugin version number, for example, 10000.