Configuration/Database Settings

From Davical
Jump to navigationJump to search
Available languages

DAViCal currently only supports a PostgreSQL backend database.

PostgreSQL Database Connection

You need to add a connect string to the configuration object:

 $c->pg_connect[] = 'dbname=davical port=5432 host=dbhost user=davical_app password=fred';

Or, for a local DB on the default port with trust authentication:

 $c->pg_connect[] = 'dbname=davical user=davical_app';

Unfortunately if a password is required for the database it will need to be in a file readable by the webserver, so there isn't a lot of security to be gained by requiring one aside from preventing untrusted users on the webserver from connecting to the database. To achieve the best security, set the configuration file to be readable by the webserver but not all users. e.g.:

 chown root:apache /etc/davical/
 chmod 640 /etc/davical/

For performance reasons you may want to use persistent connections. AWL versions from 0.24 support persistent connections by setting:

$c->use_persistent = true;


From version there is a new syntax available (though the old one will continue to work) which is:

 $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical port=5432 host=dbhost', 'dbuser' => 'davical_app', 'dbpass' => 'fred' );

Or, for a local DB on the default port with trustauthentication:

 $c->db_connect[] = array( 'dsn' => 'pgsql:dbname=davical', 'dbuser' => 'davical_app' );