mirror of
https://github.com/friendica/friendica
synced 2025-04-26 11:50:11 +00:00
Configuration if the database is opened with persistent connections
This commit is contained in:
parent
0eec3e0a0e
commit
dfea3ee3d6
2 changed files with 10 additions and 1 deletions
|
@ -134,6 +134,8 @@ class Database
|
|||
return false;
|
||||
}
|
||||
|
||||
$persistent = (bool)$this->configCache->get('database', 'persistent');
|
||||
|
||||
$this->emulate_prepares = (bool)$this->configCache->get('database', 'emulate_prepares');
|
||||
$this->pdo_emulate_prepares = (bool)$this->configCache->get('database', 'pdo_emulate_prepares');
|
||||
|
||||
|
@ -150,7 +152,7 @@ class Database
|
|||
}
|
||||
|
||||
try {
|
||||
$this->connection = @new PDO($connect, $user, $pass);
|
||||
$this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]);
|
||||
$this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares);
|
||||
$this->connected = true;
|
||||
} catch (PDOException $e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue