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