From 90f3379dfca363aa6e1f2645bcef2a33b97fcfde Mon Sep 17 00:00:00 2001 From: Retidurc Silvernight Date: Thu, 16 Jun 2022 14:30:46 +0200 Subject: [PATCH 1/4] Expose Doctrine settings in Netxcloud settings Signed-off-by: Retidurc Silvernight --- lib/private/DB/ConnectionFactory.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index 95f3185bcdb17..658b02b8ad284 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -233,6 +233,10 @@ public function createConnectionParams(string $configPrefix = '') { ]; } + if ($this->config->getValue('persistent', false)) { + $connectionParams['persistent'] = true; + } + return $connectionParams; } From 0de8729d7bf99f56a79a5cfa7647bcfdf892717f Mon Sep 17 00:00:00 2001 From: Retidurc Silvernight Date: Sun, 18 Sep 2022 16:15:58 +0200 Subject: [PATCH 2/4] Change config option to db.persistent Signed-off-by: Retidurc Silvernight --- lib/private/DB/ConnectionFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index 658b02b8ad284..83663dc54b7b7 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -233,7 +233,7 @@ public function createConnectionParams(string $configPrefix = '') { ]; } - if ($this->config->getValue('persistent', false)) { + if ($this->config->getValue('db.persistent', false)) { $connectionParams['persistent'] = true; } From 2269f3584245bd6d361daf4acf33ffd054f96b60 Mon Sep 17 00:00:00 2001 From: Retidurc Silvernight Date: Sun, 18 Sep 2022 16:34:07 +0200 Subject: [PATCH 3/4] Change option name again to be more like the other options Signed-off-by: Retidurc Silvernight --- lib/private/DB/ConnectionFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index 83663dc54b7b7..1b0ac4363647a 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -233,7 +233,7 @@ public function createConnectionParams(string $configPrefix = '') { ]; } - if ($this->config->getValue('db.persistent', false)) { + if ($this->config->getValue('dbpersistent', false)) { $connectionParams['persistent'] = true; } From 3ecd400cec44e0ec12dc0bb8935fc36cf3124f76 Mon Sep 17 00:00:00 2001 From: Retidurc Silvernight Date: Sun, 18 Sep 2022 17:05:24 +0200 Subject: [PATCH 4/4] Update config.sample.php Signed-off-by: Retidurc Silvernight --- config/config.sample.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/config.sample.php b/config/config.sample.php index 104b3e325461d..3e65008ed3bc3 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -138,6 +138,12 @@ */ '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``