当前位置: 首页>>代码示例>>PHP>>正文


PHP MySQLPDOTest::getClientVersion方法代码示例

本文整理汇总了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>
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:pdo_mysql_class_constants.php


注:本文中的MySQLPDOTest::getClientVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。