]> git.donarmstrong.com Git - roundcube.git/blob - debian/patches/dbconfig-common_support.patch
New upstream
[roundcube.git] / debian / patches / dbconfig-common_support.patch
1 --- roundcube_0.1~beta2.2/config/db.inc.php.dist        2006-03-20 23:08:51.000000000 +0100
2 +++ roundcube_0.1~beta2.2/config/db.inc.php.dist  2007-03-13 14:33:38.000000000 +0100
3 @@ -14,13 +14,20 @@
4
5  $rcmail_config = array();
6
7 -// PEAR database DSN for read/write operations
8 -// format is db_provider://user:password@host/database 
9 -// currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql
10 -
11 -$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
12 -// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
13 -// sqlite example: 'sqlite://./sqlite.db?mode=0646';
14 +/* Do not set db_dsnw here, use dpkg-reconfigure roundcube to configure database ! */
15 +
16 +include_once("/etc/roundcube/debian-db.php");
17 +
18 +switch ($dbtype) {
19 + case "sqlite":
20 +   $rcmail_config['db_dsnw'] = "sqlite:///$basepath/$dbname?mode=0640";
21 +   break;
22 + default:
23 +   if ($dbport != '') $dbport=":$dbport";
24 +   if ($dbserver == '') $dbserver="localhost";
25 +   $rcmail_config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname";
26 +   break;
27 + }
28
29  // PEAR database DSN for read only operations (if empty write database will be used)
30  // useful for database replication
31