diff options
author | Maat <maat-pub@mageia.biz> | 2013-11-30 14:43:45 +0100 |
---|---|---|
committer | Maat <maat-pub@mageia.biz> | 2013-11-30 14:47:18 +0100 |
commit | 33193de3c84f52917ba5c340591cc2d97dc42ebb (patch) | |
tree | 4b6635e7e8e8b9e69a3e58689a6f9c1241dee8f3 /phpBB/includes/db/oracle.php | |
parent | 41b19431251f19f607d192a555fdf1e57fb36643 (diff) | |
parent | 446ea9928d8373cf7695d3adda6d5ee30d5f94b4 (diff) | |
download | forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.gz forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.bz2 forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.xz forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.zip |
Merge remote-tracking branch 'upstream/prep-release-3.0.12'
Diffstat (limited to 'phpBB/includes/db/oracle.php')
-rw-r--r-- | phpBB/includes/db/oracle.php | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 62b36aa8bf..4a7a4ecc8c 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -25,6 +25,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); class dbal_oracle extends dbal { var $last_query_text = ''; + var $connect_error = ''; /** * Connect to server @@ -48,7 +49,33 @@ class dbal_oracle extends dbal $connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database; } - $this->db_connect_id = ($new_link) ? @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8') : (($this->persistency) ? @ociplogon($this->user, $sqlpassword, $connect, 'UTF8') : @ocilogon($this->user, $sqlpassword, $connect, 'UTF8')); + if ($new_link) + { + if (!function_exists('ocinlogon')) + { + $this->connect_error = 'ocinlogon function does not exist, is oci extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8'); + } + else if ($this->persistency) + { + if (!function_exists('ociplogon')) + { + $this->connect_error = 'ociplogon function does not exist, is oci extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @ociplogon($this->user, $sqlpassword, $connect, 'UTF8'); + } + else + { + if (!function_exists('ocilogon')) + { + $this->connect_error = 'ocilogon function does not exist, is oci extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @ocilogon($this->user, $sqlpassword, $connect, 'UTF8'); + } return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } @@ -647,17 +674,27 @@ class dbal_oracle extends dbal */ function _sql_error() { - $error = @ocierror(); - $error = (!$error) ? @ocierror($this->query_result) : $error; - $error = (!$error) ? @ocierror($this->db_connect_id) : $error; - - if ($error) + if (function_exists('ocierror')) { - $this->last_error_result = $error; + $error = @ocierror(); + $error = (!$error) ? @ocierror($this->query_result) : $error; + $error = (!$error) ? @ocierror($this->db_connect_id) : $error; + + if ($error) + { + $this->last_error_result = $error; + } + else + { + $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array(); + } } else { - $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array(); + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); } return $error; |