]> git.donarmstrong.com Git - roundcube.git/blob - debian/patches/dbconfig-common_support.patch
574c67ec084341e303a22fa4a17a8662c2d3b30c
[roundcube.git] / debian / patches / dbconfig-common_support.patch
1 The default db.inc.php is modified to adapt it to the use of dbconfig-common package.
2
3 Index: b/config/db.inc.php.dist
4 ===================================================================
5 --- a/config/db.inc.php.dist    2010-07-17 17:33:04.000000000 +0200
6 +++ b/config/db.inc.php.dist    2010-07-17 17:33:23.000000000 +0200
7 @@ -14,15 +14,20 @@
8  
9  $rcmail_config = array();
10  
11 -// PEAR database DSN for read/write operations
12 -// format is db_provider://user:password@host/database 
13 -// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
14 -// currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql or sqlsrv
15 +/* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database ! */
16  
17 -$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
18 -// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
19 -// Warning: for SQLite use absolute path in DSN:
20 -// sqlite example: 'sqlite:////full/path/to/sqlite.db?mode=0646';
21 +include_once("/etc/roundcube/debian-db.php");
22 +
23 +switch ($dbtype) {
24 + case "sqlite":
25 +   $rcmail_config['db_dsnw'] = "sqlite:///$basepath/$dbname?mode=0640";
26 +   break;
27 + default:
28 +   if ($dbport != '') $dbport=":$dbport";
29 +   if ($dbserver == '') $dbserver="localhost";
30 +   $rcmail_config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname";
31 +   break;
32 + }
33  
34  // PEAR database DSN for read only operations (if empty write database will be used)
35  // useful for database replication