public function getAttribute($attribute, &$source = null, $func = 'PDO::getAttribute', &$last_error = null) { switch ($attribute) { case PDO::ATTR_AUTOCOMMIT: return $this->autocommit; break; case PDO::ATTR_PREFETCH: break; case PDO::ATTR_CLIENT_VERSION: return oci_server_version($this->link); break; case PDO::ATTR_SERVER_VERSION: $ver = oci_server_version($this->link); if (preg_match('/([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/', $ver, $match)) { return $match[1]; } return $ver; break; case PDO::ATTR_SERVER_INFO: return oci_server_version($this->link); break; default: return parent::getAttribute($attribute, $source, $func, $last_error); break; } }
/** * {@inheritdoc} * * @throws \UnexpectedValueException if the version string returned by the database server * does not contain a parsable version number. */ public function getServerVersion() { if (!preg_match('/\\s+(\\d+\\.\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+/', oci_server_version($this->dbh), $version)) { throw new \UnexpectedValueException(sprintf('Unexpected database version string "%s". Cannot parse an appropriate version number from it. ' . 'Please report this database version string to the Doctrine team.', oci_server_version($this->dbh))); } return $version[1]; }
/** * Returns oracle version. * * @throws \UnexpectedValueException if the version string returned by the database server does not parsed * @return int Version number */ public function getServerVersion() { $versionData = oci_server_version($this->dbh); if (!preg_match('/\\s+(\\d+\\.\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+/', $versionData, $version)) { throw new \UnexpectedValueException(__('Unexpected database version string "{0}" that not parsed.', $versionData)); } return $version[1]; }
/** +---------------------------------------------------------- * 连接数据库方法 +---------------------------------------------------------- * @access public +---------------------------------------------------------- * @throws ThinkExecption +---------------------------------------------------------- */ public function connect($config = '', $linkNum = 0) { if (!isset($this->linkID[$linkNum])) { if (empty($config)) { $config = $this->config; } $conn = $this->pconnect ? 'oci_pconnect' : 'oci_new_connect'; $this->linkID[$linkNum] = $conn($config['username'], $config['password'], "//{$config['hostname']}:{$config['hostport']}/{$config['database']}"); //modify by wyfeng at 2008.12.19 if (!$this->linkID[$linkNum]) { $error = $this->error(false); throw_exception($error["message"], '', $error["code"]); return false; } $this->dbVersion = oci_server_version($this->linkID[$linkNum]); // 标记连接成功 $this->connected = true; //注销数据库安全信息 if (1 != C('DB_DEPLOY_TYPE')) { unset($this->config); } } return $this->linkID[$linkNum]; }
/** * Version information about used database * @param bool $raw if true, only return the fetched sql_server_version * @return string sql server version */ function sql_server_info($raw = false) { $this->sql_server_version = @oci_server_version($this->connect); return $this->sql_server_version; }
public function getServerVersion() { set_error_handler(static::getErrorHandler()); $serverVersion = oci_server_version($this->resource); restore_error_handler(); return $serverVersion; }
/** * @return string Version information from the database */ function getServerVersion() { //better version number, fallback on driver $rset = $this->doQuery('SELECT version FROM product_component_version WHERE UPPER(product) LIKE \'ORACLE DATABASE%\''); if (!($row = $rset->fetchRow())) { return oci_server_version($this->mConn); } return $row['version']; }
/** * @return array|mixed */ public function getDbInfo() { $arrReturn = array(); $arrReturn["dbdriver"] = "oci8-oracle-extension"; $arrReturn["dbserver"] = oci_server_version($this->linkDB); $arrReturn["dbclient"] = function_exists("oci_client_version") ? oci_client_version($this->linkDB) : ""; return $arrReturn; }
/** * Version number query string * * @access protected * @return string */ protected function _version() { return oci_server_version($this->conn_id); }
function versionOracle() { /////////////////////// /////////////////////// ////////////////////// // TODO EN PDO $conn = oci_connect('scott', 'tiger', '10.0.220.100:1521/ORAPROF'); $version = oci_server_version($conn); oci_close($conn); return $version; }
public function version() { if (!empty($this->connect)) { return oci_server_version($this->connect); } else { return false; } }
/** * 获取服务器信息 * * @return string 服务器信息 */ public function server_info() { return oci_server_version($this->db_link); }
public function getDbInfo() { return array("Server version" => @oci_server_version($this->database), "Express" => $this->isExpress()); }
function php_sql() { $get_version = explode("-", oci_server_version($this->dbh)); return "ENV: php " . phpversion() . "[Oracle " . $get_version[0] . "]"; }
function ServerInfo() { $arr['compat'] = $this->GetOne('select value from sys.database_compatible_level'); $arr['description'] = @oci_server_version($this->_connectionID); $arr['version'] = ADOConnection::_findvers($arr['description']); return $arr; }
/** * @return string Version information from the database */ function getServerVersion() { return oci_server_version($this->mConn); }
//var_dump(get_loaded_extensions()); if (!extension_loaded("oci8")) { die("Extenstion oci8 is not loaded"); } $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.99.100)(PORT = 49161)))(CONNECT_DATA=(SID=XE)))"; $username = "******"; $password = "******"; if ($vcap_service_env = getenv("VCAP_SERVICES")) { $vcap = json_decode($vcap_service_env, true); $userProvidedTypes = !empty($vcap['user-provided']) ? $vcap['user-provided'] : array(); foreach ($userProvidedTypes as $userProvided) { if (stripos($userProvided['name'], 'oracle-11-docker') !== false) { $credentials = $userProvided['credentials']; $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)"; $db .= "(HOST =" . $credentials['host'] . " )(PORT = " . $credentials['port'] . ")))"; $db .= "(CONNECT_DATA=(SID=" . $credentials['sid'] . ")))"; $username = $credentials['username']; $password = $credentials['password']; break; } } } //Simple connexion test $oci_connect = oci_connect($username, $password, $db); if (!$oci_connect) { $e = oci_error(); die(print_r($e)); } echo "Connected to Oracle Using OCI8" . "<br />"; echo "Server Version: " . oci_server_version($oci_connect);
/** * Returns database server info array * @return array Array containing 'description' and 'version' info */ public function get_server_info() { static $info = null; // TODO: move to real object property if (is_null($info)) { $this->query_start("--oci_server_version()", null, SQL_QUERY_AUX); $description = oci_server_version($this->oci); $this->query_end(true); preg_match('/(\\d+\\.)+\\d+/', $description, $matches); $info = array('description' => $description, 'version' => $matches[0]); } return $info; }
function version() { return oci_server_version($this->link); }
/** * Database version number. * * @return string */ public function version() { if (isset($this->data_cache['version'])) { return $this->data_cache['version']; } if (!$this->conn_id or ($version_string = oci_server_version($this->conn_id)) === false) { return false; } elseif (preg_match('#Release\\s(\\d+(?:\\.\\d+)+)#', $version_string, $match)) { return $this->data_cache['version'] = $match[1]; } return false; }
function PMA_DBI_server_version($link) { return oci_server_version($link); //return oci_field_flags($result, $i); }
/** * Database version number * * @return string */ public function version() { return isset($this->data_cache['version']) ? $this->data_cache['version'] : ($this->data_cache['version'] = oci_server_version($this->conn_id)); }
public function ServerVer() { if (is_resource($this->conn_handle)) { return @oci_server_version($this->conn_handle); } else { return false; } }
/** * Retrieve server version in PHP style * * @return string */ public function getServerVersion() { $this->_connect(); $version = oci_server_version($this->_connection); if ($version !== false) { $matches = null; if (preg_match('/((?:[0-9]{1,2}\\.){1,3}[0-9]{1,2})/', $version, $matches)) { return $matches[1]; } else { return null; } } else { return null; } }
/** * Returns the server version string. * * @return string * @access public * @author Thorsten Rinne <*****@*****.**> * @since 2005-09-20 */ public function server_version() { return oci_server_version($this->conn); }
/** * Database version number * * @return string */ public function version() { if (isset($this->data_cache['version'])) { return $this->data_cache['version']; } if (!$this->conn_id or ($version = oci_server_version($this->conn_id)) === FALSE) { return FALSE; } return $this->data_cache['version'] = $version; }
/** * Retrieve a database connection attribute * * @param integer $attribute * @return mixed */ public function getAttribute($attribute) { if ($attribute === PDO::ATTR_SERVER_VERSION && !isset($this->options[$attribute])) { return $this->options[$attribute] = oci_server_version($this->dbh); } if (isset($this->options[$attribute])) { return $this->options[$attribute]; } return null; }