本文整理汇总了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();
}
}