diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-03-09 21:50:45 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 04:40:47 -0500 |
commit | 025a95ea909d449e14cb22564983fb005e3f8c06 (patch) | |
tree | 947ee8343372097550dc0b622b6ef959be38020d /phpBB/includes/db/sqlite.php | |
parent | e64c5117b9748208a87df80aff6012f3aae573ad (diff) | |
download | forums-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/sqlite.php')
-rw-r--r-- | phpBB/includes/db/sqlite.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 8de72fd394..be0ad4fc8f 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -25,6 +25,8 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); */ class dbal_sqlite extends dbal { + var $connect_error = ''; + /** * Connect to server */ @@ -36,7 +38,24 @@ class dbal_sqlite extends dbal $this->dbname = $database; $error = ''; - $this->db_connect_id = ($this->persistency) ? @sqlite_popen($this->server, 0666, $error) : @sqlite_open($this->server, 0666, $error); + if ($this->persistency) + { + if (!function_exists('sqlite_popen')) + { + $this->connect_error = 'sqlite_popen function does not exist, is sqlite extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @sqlite_popen($this->server, 0666, $error); + } + else + { + if (!function_exists('sqlite_open')) + { + $this->connect_error = 'sqlite_open function does not exist, is sqlite extension installed?'; + return $this->sql_error(''); + } + $this->db_connect_id = @sqlite_open($this->server, 0666, $error); + } if ($this->db_connect_id) { |