aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/sqlite3.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-07-07 21:56:35 +0200
committerTristan Darricau <github@nicofuma.fr>2014-07-07 21:56:35 +0200
commit42fde81b21968704dd00ef514fe4035aa174968d (patch)
tree5bd8470e48184838ca0621a56766d8b338419d98 /phpBB/phpbb/db/driver/sqlite3.php
parent80f8c550f9c4bdc393a673c402c846c1f8de0bb9 (diff)
parent3ca708edadce1c82903559f384fd15638d0ab2de (diff)
downloadforums-42fde81b21968704dd00ef514fe4035aa174968d.tar
forums-42fde81b21968704dd00ef514fe4035aa174968d.tar.gz
forums-42fde81b21968704dd00ef514fe4035aa174968d.tar.bz2
forums-42fde81b21968704dd00ef514fe4035aa174968d.tar.xz
forums-42fde81b21968704dd00ef514fe4035aa174968d.zip
Merge pull request #2690 from Noxwizard/ticket/12802
[ticket/12802] Properly handle connection failures in SQLite3 * Noxwizard/ticket/12802: [ticket/12802] Properly handle connection failures in SQLite3
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 6511c755a0..0922229e0a 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -50,9 +50,10 @@ class sqlite3 extends \phpbb\db\driver\driver
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
$this->db_connect_id = true;
}
- catch (Exception $e)
+ catch (\Exception $e)
{
- return array('message' => $e->getMessage());
+ $this->connect_error = $e->getMessage();
+ return array('message' => $this->connect_error);
}
return true;
@@ -280,7 +281,7 @@ class sqlite3 extends \phpbb\db\driver\driver
*/
protected function _sql_error()
{
- if (class_exists('SQLite3', false))
+ if (class_exists('SQLite3', false) && isset($this->dbo))
{
$error = array(
'message' => $this->dbo->lastErrorMsg(),