本文整理匯總了PHP中CI_DB::version方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_DB::version方法的具體用法?PHP CI_DB::version怎麽用?PHP CI_DB::version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CI_DB
的用法示例。
在下文中一共展示了CI_DB::version方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: version
/**
* Database version number
*
* @return string
*/
public function version()
{
if (isset($this->data_cache['version'])) {
return $this->data_cache['version'];
}
if (!$this->conn_id or ($pg_version = pg_version($this->conn_id)) === FALSE) {
return FALSE;
}
/* If PHP was compiled with PostgreSQL lib versions earlier
* than 7.4, pg_version() won't return the server version
* and so we'll have to fall back to running a query in
* order to get it.
*/
return isset($pg_version['server']) ? $this->data_cache['version'] = $pg_version['server'] : parent::version();
}
示例2: version
/**
* Database version number
*
* @return string
*/
public function version()
{
if (isset($this->data_cache['version'])) {
return $this->data_cache['version'];
}
// Not all subdrivers support the getAttribute() method
try {
return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION);
} catch (PDOException $e) {
return parent::version();
}
}