Browse Source

Merge pull request #11783 from owncloud/allow_passing_driver_options

allow passing db driver options
tags/v8.0.0alpha1
Morris Jobke 9 years ago
parent
commit
a00712aa65
2 changed files with 14 additions and 0 deletions
  1. 7
    0
      config/config.sample.php
  2. 7
    0
      lib/private/db/connectionfactory.php

+ 7
- 0
config/config.sample.php View File

@@ -119,6 +119,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

+ 7
- 0
lib/private/db/connectionfactory.php View File

@@ -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;
}
}

Loading…
Cancel
Save