diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-13 07:56:40 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-13 07:56:40 -0500 |
commit | aae7a81270013f0f700033dd091fd9db216eb889 (patch) | |
tree | b9c3566c7d3e5f6c56677cd1ae68be28bb4b1314 /phpBB/includes/db/driver/sqlite.php | |
parent | 10ee54d0280087a81236c05fbaf2c30f3b976b08 (diff) | |
parent | 0916dc14efaa36073cdc9783401b818ecc0716cc (diff) | |
download | forums-aae7a81270013f0f700033dd091fd9db216eb889.tar forums-aae7a81270013f0f700033dd091fd9db216eb889.tar.gz forums-aae7a81270013f0f700033dd091fd9db216eb889.tar.bz2 forums-aae7a81270013f0f700033dd091fd9db216eb889.tar.xz forums-aae7a81270013f0f700033dd091fd9db216eb889.zip |
Merge remote-tracking branch 'upstream/develop' into ticket/11015
* upstream/develop: (101 commits)
[ticket/10491] Make recreate_database static.
[ticket/11088] Pass required objects in as arguments
[ticket/11088] Globalize objects in new permission function
[ticket/11088] Move permission creation to a function
[ticket/11088] Copy a_styles permission for a_extensions
[ticket/11088] Remove extraneous word from sentence in comment
[ticket/11088] Changed "file extensions" to "attachment extensions"
[ticket/11088] Fix the database updater to correctly manipulate the modules
[ticket/11088] Put language pack module move below extension module creation
[ticket/11088] Untested, progress on update script
[ticket/11088] Fix typo (period instead of comma)
[ticket/11088] Untested progress for update script
[ticket/11088] Added missing comma
[ticket/11088] Removed added space
[ticket/11088] Move style, extension and language pack management to customise
[ticket/11243] Show download all link on all pages of topic with attachments
[feature/template-events] Pass arguments in correct order.
[feature/template-events] Pass arguments in correct order.
[ticket/10491] Install board once per test run.
[ticket/11257] Do not require set_name() method to exist
...
Diffstat (limited to 'phpBB/includes/db/driver/sqlite.php')
-rw-r--r-- | phpBB/includes/db/driver/sqlite.php | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/phpBB/includes/db/driver/sqlite.php b/phpBB/includes/db/driver/sqlite.php index 0b09fa758d..6b9cc64d89 100644 --- a/phpBB/includes/db/driver/sqlite.php +++ b/phpBB/includes/db/driver/sqlite.php @@ -22,6 +22,8 @@ if (!defined('IN_PHPBB')) */ class phpbb_db_driver_sqlite extends phpbb_db_driver { + var $connect_error = ''; + /** * Connect to server */ @@ -33,7 +35,24 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver $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) { @@ -278,10 +297,22 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver */ 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; } /** |