mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
Fix Auto-Installer
This commit is contained in:
parent
c0afa761ac
commit
ca36ea17f9
2 changed files with 30 additions and 20 deletions
|
@ -90,9 +90,12 @@ class Database
|
|||
public function connect()
|
||||
{
|
||||
if (!is_null($this->connection) && $this->connected()) {
|
||||
return true;
|
||||
return $this->connected;
|
||||
}
|
||||
|
||||
// Reset connected state
|
||||
$this->connected = false;
|
||||
|
||||
$port = 0;
|
||||
$serveraddr = trim($this->configCache->get('database', 'hostname'));
|
||||
$serverdata = explode(':', $serveraddr);
|
||||
|
@ -187,19 +190,20 @@ class Database
|
|||
*/
|
||||
public function disconnect()
|
||||
{
|
||||
if (is_null($this->connection)) {
|
||||
return;
|
||||
if (!is_null($this->connection)) {
|
||||
switch ($this->driver) {
|
||||
case 'pdo':
|
||||
$this->connection = null;
|
||||
break;
|
||||
case 'mysqli':
|
||||
$this->connection->close();
|
||||
$this->connection = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($this->driver) {
|
||||
case 'pdo':
|
||||
$this->connection = null;
|
||||
break;
|
||||
case 'mysqli':
|
||||
$this->connection->close();
|
||||
$this->connection = null;
|
||||
break;
|
||||
}
|
||||
$this->driver = null;
|
||||
$this->connected = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -369,6 +373,7 @@ class Database
|
|||
$connected = $this->connection->ping();
|
||||
break;
|
||||
}
|
||||
|
||||
return $connected;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue