Skip to content

Commit

Permalink
Merge pull request #32899 from Retidurc/pdo-attr-persistent
Browse files Browse the repository at this point in the history
Expose Doctrine support for persistent connections in PDO in Nextcloud settings
  • Loading branch information
blizzz authored Oct 3, 2022
2 parents f055328 + 3ecd400 commit 3efc9d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
4 changes: 4 additions & 0 deletions lib/private/DB/ConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ public function createConnectionParams(string $configPrefix = '') {
];
}

if ($this->config->getValue('dbpersistent', false)) {
$connectionParams['persistent'] = true;
}

return $connectionParams;
}

Expand Down

0 comments on commit 3efc9d7

Please sign in to comment.