aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-10-03 12:34:39 +0200
committerGitHub <noreply@github.com>2022-10-03 12:34:39 +0200
commit3efc9d7d376df82ef1e0000c2f3daccfce68cbfd (patch)
tree3e9ca90f8e75eb5b666fe811aa1a3281d7acaf6f
parentf0553280947173995fd615d936684964fa43cc1c (diff)
parent3ecd400cec44e0ec12dc0bb8935fc36cf3124f76 (diff)
downloadnextcloud-server-3efc9d7d376df82ef1e0000c2f3daccfce68cbfd.tar.gz
nextcloud-server-3efc9d7d376df82ef1e0000c2f3daccfce68cbfd.zip
Merge pull request #32899 from Retidurc/pdo-attr-persistent
Expose Doctrine support for persistent connections in PDO in Nextcloud settings
-rw-r--r--config/config.sample.php6
-rw-r--r--lib/private/DB/ConnectionFactory.php4
2 files changed, 10 insertions, 0 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 104b3e32546..3e65008ed3b 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -138,6 +138,12 @@ $CONFIG = [
*/
'dbtableprefix' => '',
+/**
+ * Enable persistent connexions to the database.
+ * This setting uses the "persistent" option from doctrine dbal, wich in turns
+ * uses the PDO::ATTR_PERSISTENT option from de pdo driver.
+ */
+'dbpersistent' => '',
/**
* Indicates whether the Nextcloud instance was installed successfully; ``true``
diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php
index 95f3185bcdb..1b0ac436364 100644
--- a/lib/private/DB/ConnectionFactory.php
+++ b/lib/private/DB/ConnectionFactory.php
@@ -233,6 +233,10 @@ class ConnectionFactory {
];
}
+ if ($this->config->getValue('dbpersistent', false)) {
+ $connectionParams['persistent'] = true;
+ }
+
return $connectionParams;
}