aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/sqlite.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-12-07 21:14:39 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2012-12-07 21:14:39 -0600
commit0042f071476b75258f5f8ea0b5b9fcb445ffde23 (patch)
tree67cbafd7c655ad94809fef5f7dbe3a23525b232b /phpBB/includes/db/sqlite.php
parentc911a34b5b7541b46ee2408da366d2dc7c302090 (diff)
parentb7b8fefdd084b51c93b15dfdfb34d2ef294f4d76 (diff)
downloadforums-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/sqlite.php')
-rw-r--r--phpBB/includes/db/sqlite.php41
1 files changed, 36 insertions, 5 deletions
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 5fc89ced18..06e368d586 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -24,6 +24,8 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
*/
class dbal_sqlite extends dbal
{
+ var $connect_error = '';
+
/**
* Connect to server
*/
@@ -35,7 +37,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)
{
@@ -280,10 +299,22 @@ class dbal_sqlite extends dbal
*/
function _sql_error()
{
- return array(
- 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)),
- 'code' => @sqlite_last_error($this->db_connect_id)
- );
+ if (function_exists('sqlite_error_string'))
+ {
+ $error = array(
+ 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)),
+ 'code' => @sqlite_last_error($this->db_connect_id),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
}
/**