diff options
-rw-r--r-- | config/config.sample.php | 6 | ||||
-rw-r--r-- | lib/private/DB/ConnectionFactory.php | 4 |
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; } |