aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/oracle.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-03-09 21:50:45 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-04 04:40:47 -0500
commit025a95ea909d449e14cb22564983fb005e3f8c06 (patch)
tree947ee8343372097550dc0b622b6ef959be38020d /phpBB/includes/db/oracle.php
parente64c5117b9748208a87df80aff6012f3aae573ad (diff)
downloadforums-025a95ea909d449e14cb22564983fb005e3f8c06.tar
forums-025a95ea909d449e14cb22564983fb005e3f8c06.tar.gz
forums-025a95ea909d449e14cb22564983fb005e3f8c06.tar.bz2
forums-025a95ea909d449e14cb22564983fb005e3f8c06.tar.xz
forums-025a95ea909d449e14cb22564983fb005e3f8c06.zip
[ticket/10205] Account for potentially missing extensions in dbal.
PHPBB3-10205
Diffstat (limited to 'phpBB/includes/db/oracle.php')
-rw-r--r--phpBB/includes/db/oracle.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 62b36aa8bf..42f5de1b24 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('');
}