diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-10-27 16:00:13 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-10-27 16:00:13 +0100 |
commit | a00712aa65169b248cac8e541dfe69fd82082609 (patch) | |
tree | 82944a0942f277734d104071a5a8f9a1a47e11da | |
parent | 8de287f2efe2eafcbda8c54590e363486719257e (diff) | |
parent | de72aff2c1303b848cbf6fa49ea3d8a466344491 (diff) | |
download | nextcloud-server-a00712aa65169b248cac8e541dfe69fd82082609.tar.gz nextcloud-server-a00712aa65169b248cac8e541dfe69fd82082609.zip |
Merge pull request #11783 from owncloud/allow_passing_driver_options
allow passing db driver options
-rw-r--r-- | config/config.sample.php | 7 | ||||
-rw-r--r-- | lib/private/db/connectionfactory.php | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 621e5df80b3..268b7cc9d08 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -120,6 +120,13 @@ $CONFIG = array( 'dbtableprefix' => '', /** + * Additional driver options for the database connection, eg. to enable SSL encryption in MySQL: + */ +'dbdriveroptions' => array( + PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem', +), + +/** * Indicates whether the ownCloud instance was installed successfully; ``true`` * indicates a successful installation, and ``false`` indicates an unsuccessful * installation. diff --git a/lib/private/db/connectionfactory.php b/lib/private/db/connectionfactory.php index 1f676f1fca2..f6253e09b95 100644 --- a/lib/private/db/connectionfactory.php +++ b/lib/private/db/connectionfactory.php @@ -153,6 +153,13 @@ class ConnectionFactory { } $connectionParams['tablePrefix'] = $config->getSystemValue('dbtableprefix', 'oc_'); + + //additional driver options, eg. for mysql ssl + $driverOptions = $config->getSystemValue('dbdriveroptions', null); + if ($driverOptions) { + $connectionParams['driverOptions'] = $driverOptions; + } + return $connectionParams; } } |