diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-07 21:14:39 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-07 21:14:39 -0600 |
commit | 0042f071476b75258f5f8ea0b5b9fcb445ffde23 (patch) | |
tree | 67cbafd7c655ad94809fef5f7dbe3a23525b232b /phpBB/includes/db/oracle.php | |
parent | c911a34b5b7541b46ee2408da366d2dc7c302090 (diff) | |
parent | b7b8fefdd084b51c93b15dfdfb34d2ef294f4d76 (diff) | |
download | forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.gz forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.bz2 forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.tar.xz forums-0042f071476b75258f5f8ea0b5b9fcb445ffde23.zip |
Merge branch 'develop' of github.com:EXreaction/phpbb3 into ticket/11103
Conflicts:
phpBB/install/database_update.php
phpBB/styles/prosilver/template/ucp_prefs_personal.html
phpBB/styles/subsilver2/template/ucp_prefs_personal.html
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 6d9339b2d8..4a2b107865 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -24,6 +24,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 @@ -47,7 +48,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(''); } @@ -646,17 +673,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; |