本文整理汇总了PHP中MySQLPDOTest::getClientVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQLPDOTest::getClientVersion方法的具体用法?PHP MySQLPDOTest::getClientVersion怎么用?PHP MySQLPDOTest::getClientVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQLPDOTest
的用法示例。
在下文中一共展示了MySQLPDOTest::getClientVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc';
$expected = array('MYSQL_ATTR_USE_BUFFERED_QUERY' => true, 'MYSQL_ATTR_LOCAL_INFILE' => true, 'MYSQL_ATTR_DIRECT_QUERY' => true, 'MYSQL_ATTR_FOUND_ROWS' => true, 'MYSQL_ATTR_IGNORE_SPACE' => true, 'MYSQL_ATTR_INIT_COMMAND' => true, "MYSQL_ATTR_SSL_KEY" => true, "MYSQL_ATTR_SSL_CERT" => true, "MYSQL_ATTR_SSL_CA" => true, "MYSQL_ATTR_SSL_CAPATH" => true, "MYSQL_ATTR_SSL_CIPHER" => true, "MYSQL_ATTR_COMPRESS" => true);
if (!MySQLPDOTest::isPDOMySQLnd()) {
$expected['MYSQL_ATTR_MAX_BUFFER_SIZE'] = true;
$expected['MYSQL_ATTR_READ_DEFAULT_FILE'] = true;
$expected['MYSQL_ATTR_READ_DEFAULT_GROUP'] = true;
}
if (extension_loaded('mysqlnd')) {
$expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
} else {
if (extension_loaded('mysqli')) {
if (mysqli_get_client_version() > 50605) {
$expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
}
} else {
if (MySQLPDOTest::getClientVersion(MySQLPDOTest::factory()) > 50605) {
/* XXX the MySQL client library version isn't exposed with any
constants, the single possibility is to use the PDO::getAttribute().
This however will fail with no connection. */
$expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
}
}
}
/*
TODO
MYSQLI_OPT_CONNECT_TIMEOUT != PDO::ATTR_TIMEOUT (integer)
Sets the timeout value in seconds for communications with the database.
^ Potential BUG, PDO::ATTR_TIMEOUT is used in pdo_mysql_handle_factory
MYSQLI_SET_CHARSET_NAME -> DSN/charset=<charset_name>