diff options
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r-- | phpBB/phpbb/db/driver/sqlite3.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php index 4ca3d8f91d..5548105006 100644 --- a/phpBB/phpbb/db/driver/sqlite3.php +++ b/phpBB/phpbb/db/driver/sqlite3.php @@ -52,7 +52,8 @@ class sqlite3 extends \phpbb\db\driver\driver } catch (\Exception $e) { - return array('message' => $e->getMessage()); + $this->connect_error = $e->getMessage(); + return array('message' => $this->connect_error); } return true; @@ -121,6 +122,10 @@ class sqlite3 extends \phpbb\db\driver\driver { $this->sql_report('start', $query); } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } $this->last_query_text = $query; $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; @@ -137,6 +142,10 @@ class sqlite3 extends \phpbb\db\driver\driver { $this->sql_report('stop', $query); } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } if (!$this->query_result) { @@ -277,7 +286,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(), |