Skip to content

Commit

Permalink
Ensure we have an initialized database connection when running getVer…
Browse files Browse the repository at this point in the history
…sion. Fixes #255
  • Loading branch information
lonnieezell committed Sep 10, 2016
1 parent a379add commit 6879c18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ public function getVersion()
return $this->dataCache['version'];
}

if (empty($this->mysqli))
{
$this->initialize();
}

return $this->dataCache['version'] = $this->mysqli->server_info;
}

Expand Down
2 changes: 1 addition & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function getVersion()

if ( ! $this->connID or ($pgVersion = pg_version($this->connID)) === false)
{
return false;
$this->initialize();
}

return isset($pgVersion['server'])
Expand Down

0 comments on commit 6879c18

Please sign in to comment.