mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12802] Properly handle connection failures in SQLite3
PHPBB3-12802
This commit is contained in:
parent
ad11925c77
commit
3ca708edad
1 changed files with 4 additions and 3 deletions
|
@ -50,9 +50,10 @@ class sqlite3 extends \phpbb\db\driver\driver
|
||||||
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
|
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
|
||||||
$this->db_connect_id = true;
|
$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;
|
return true;
|
||||||
|
@ -272,7 +273,7 @@ class sqlite3 extends \phpbb\db\driver\driver
|
||||||
*/
|
*/
|
||||||
protected function _sql_error()
|
protected function _sql_error()
|
||||||
{
|
{
|
||||||
if (class_exists('SQLite3', false))
|
if (class_exists('SQLite3', false) && isset($this->dbo))
|
||||||
{
|
{
|
||||||
$error = array(
|
$error = array(
|
||||||
'message' => $this->dbo->lastErrorMsg(),
|
'message' => $this->dbo->lastErrorMsg(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue