X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/38379
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Allow force set DB patforms

A new 'db.platform' option added to config.php. It allows using a specific
database platform and do not rely on autodetection.

https://github.com/owncloud/core/pull/38379
12 changes: 12 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,18 @@
*/
'mysql.utf8mb4' => false,

/**
* Force a specific database platform class.
* False means that autodetection will take place.
*
* E.g. to fix MariaDB 1.2.7+ taken for MySQL
* 'db.platform' => '\Doctrine\DBAL\Platforms\MariaDb1027Platform',
*
* See:
* https://docs.microsoft.com/en-us/azure/mariadb/concepts-limits#current-known-issues
*/
'db.platform' => false,

/**
* Define supported database types
* Database types that are supported for installation.
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 @@ -78,6 +78,10 @@ public function __construct(SystemConfig $systemConfig) {
if ($this->config->getValue('mysql.utf8mb4', false)) {
$this->defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
}
$dbPlatform = $this->config->getValue('db.platform', false);
if ($dbPlatform !== false) {
$this->defaultConnectionParams['mysql']['platform'] = new $dbPlatform();
}
}

/**
Expand Down
X Tutup