mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-16 05:50:55 +08:00
change file require order to fix get config from database
This commit is contained in:
@@ -39,7 +39,9 @@ class DB
|
||||
|
||||
public function connect($host, $username, $password, $database, $port)
|
||||
{
|
||||
return $this->driver->connect($host, $username, $password, $database, $port);
|
||||
if (is_null($this->driver)) {
|
||||
$this->driver->connect($host, $username, $password, $database, $port);
|
||||
}
|
||||
}
|
||||
|
||||
public function query(string $sql)
|
||||
@@ -108,6 +110,11 @@ class DB
|
||||
return $this->driver->freeResult($result);
|
||||
}
|
||||
|
||||
public function isConnected()
|
||||
{
|
||||
return !is_null($this->driver);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user