]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/Database.php
NL translation update THX casperrutten33
[friendica.git] / src / Database / Database.php
index d155a9276c711e681576a35340483ee214ba0f1b..80fd02dc0d5f230c26cd91057c5ae5c85fe685f2 100644 (file)
@@ -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) {
@@ -1419,7 +1421,7 @@ class Database
                        if (is_bool($old_fields)) {
                                if ($do_insert) {
                                        $values = array_merge($condition, $fields);
-                                       return $this->insert($table, $values, $do_insert);
+                                       return $this->replace($table, $values);
                                }
                                $old_fields = [];
                        }