本文整理汇总了PHP中cubrid_get_server_info函数的典型用法代码示例。如果您正苦于以下问题:PHP cubrid_get_server_info函数的具体用法?PHP cubrid_get_server_info怎么用?PHP cubrid_get_server_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cubrid_get_server_info函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __connect
/**
* DB Connect
* this method is private
* @param array $connection connection's value is db_hostname, db_port, db_database, db_userid, db_password
* @return resource
*/
function __connect($connection)
{
// attempts to connect
$result = @cubrid_connect($connection["db_hostname"], $connection["db_port"], $connection["db_database"], $connection["db_userid"], $connection["db_password"]);
// check connections
if (!$result) {
$this->setError(-1, 'database connect fail');
return;
}
if (!defined('__CUBRID_VERSION__')) {
$cubrid_version = cubrid_get_server_info($result);
$cubrid_version_elem = explode('.', $cubrid_version);
$cubrid_version = $cubrid_version_elem[0] . '.' . $cubrid_version_elem[1] . '.' . $cubrid_version_elem[2];
define('__CUBRID_VERSION__', $cubrid_version);
}
if (__CUBRID_VERSION__ >= '8.4.0') {
cubrid_set_autocommit($result, CUBRID_AUTOCOMMIT_TRUE);
}
return $result;
}
示例2: __connect
/**
* DB Connect
* this method is private
* @param array $connection connection's value is db_hostname, db_port, db_database, db_userid, db_password
* @return resource
*/
function __connect($connection)
{
// attempts to connect
$result = @cubrid_connect($connection['host'], $connection['port'], $connection['database'], $connection['user'], $connection['pass']);
// check connections
if (!$result) {
$this->setError(-1, 'database connect fail');
return;
}
if (!defined('__CUBRID_VERSION__')) {
$cubrid_version = cubrid_get_server_info($result);
$cubrid_version_elem = explode('.', $cubrid_version);
$cubrid_version = $cubrid_version_elem[0] . '.' . $cubrid_version_elem[1] . '.' . $cubrid_version_elem[2];
define('__CUBRID_VERSION__', $cubrid_version);
}
if (version_compare(__CUBRID_VERSION__, '9.0', '<')) {
$this->setError(-1, 'Rhymix requires CUBRID 9.0 or later. Current CUBRID version is ' . __CUBRID_VERSION__);
return;
}
cubrid_set_autocommit($result, CUBRID_AUTOCOMMIT_TRUE);
return $result;
}
示例3: _version
/**
* Version number query string
*
* @access public
* @return string
*/
function _version()
{
// To obtain the CUBRID Server version, no need to run the SQL query.
// CUBRID PHP API provides a function to determin this value.
// This is why we also need to add 'cubrid' value to the list of
// $driver_version_exceptions array in DB_driver class in
// version() function.
return cubrid_get_server_info($this->conn_id);
}
示例4: version
/**
* Database version number
*
* @return string
*/
public function version()
{
if (isset($this->data_cache['version'])) {
return $this->data_cache['version'];
} elseif (!$this->conn_id) {
$this->initialize();
}
return (!$this->conn_id or ($version = cubrid_get_server_info($this->conn_id)) === FALSE) ? FALSE : ($this->data_cache['version'] = $version);
}
示例5: version
/**
* Database version number
*
* @return string
*/
public function version()
{
return isset($this->data_cache['version']) ? $this->data_cache['version'] : ($this->data_cache['version'] = cubrid_get_server_info($this->conn_id));
}
示例6: version
/**
* Get this db version
*
* @return void
*/
public function version()
{
return cubrid_get_server_info($this->link);
}
示例7: testCubridGetServerInfo3
/**
* @group arnia-wrong-parameters
*/
public function testCubridGetServerInfo3()
{
if (OUTPUT_FUNCTION_NAME == true) {
echo "\r\nRunning: " . __FUNCTION__ . " = ";
}
try {
$val = cubrid_get_server_info(" ");
$this->assertTrue(FALSE, "Expected Exception not thrown.");
} catch (Exception $e) {
//echo $e->getMessage()."\r\n";
$this->assertEquals(0, cubrid_error_code());
$this->assertEquals(0, cubrid_error_code_facility());
$this->assertEquals('', cubrid_error_msg());
}
}
示例8: sql_server_info
function sql_server_info($link = null)
{
if (isset($link)) {
$result = cubrid_get_server_info($link);
}
if (!isset($link)) {
$result = cubrid_get_server_info();
}
return $result;
}
示例9: _version
function _version()
{
return cubrid_get_server_info($this->conn_id);
}
示例10: version
/**
* Database version number.
*
* @return string
*/
public function version()
{
if (isset($this->data_cache['version'])) {
return $this->data_cache['version'];
}
return (!$this->conn_id or ($version = cubrid_get_server_info($this->conn_id)) === false) ? false : ($this->data_cache['version'] = $version);
}