示例#1
0
 /**
  * Creates a PDO instance representing a connection to a database
  *
  * @param string $dsn The Data Source Name, or DSN, contains the information required to connect to the database.
  * @param string $username The user name for the DSN string.
  * @param string $password The password for the DSN string.
  * @param array $options A key=>value array of driver-specific connection options.
  */
 public function __construct($dsn, $username = null, $password = null, array $options = [])
 {
     $parsedDsn = Oci8\Util::parseDsn($dsn, ['dbname', 'charset']);
     $this->setAttribute(PDO::ATTR_CLIENT_VERSION, oci_client_version());
     // can't do a simple array_merge because keys are numeric
     foreach ($options as $option => $value) {
         $this->setAttribute($option, $value);
     }
     if ($this->getAttribute(PDO::ATTR_PERSISTENT)) {
         $this->dbh = oci_pconnect($username, $password, $parsedDsn['dbname'], $parsedDsn['charset']);
     } else {
         $this->dbh = oci_connect($username, $password, $parsedDsn['dbname'], $parsedDsn['charset']);
     }
     if ($this->dbh === false) {
         $this->handleError($this->error = oci_error());
     }
 }
示例#2
0
 /**
  * @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;
 }
示例#3
0
/**
 * returns a string that represents the client library version
 * @uses    mysql_get_client_info()
 * @return  string          MySQL client library version
 */
function PMA_DBI_get_client_info()
{
    return oci_client_version();
}
示例#4
0
 public function getClientVersion()
 {
     return oci_client_version();
 }