[imp] Some questions about the 2.3.x CVS version.

Jon Parise jon@csh.rit.edu
Sat, 17 Feb 2001 15:37:54 -0500


On Sat, Feb 17, 2001 at 03:22:51PM -0500, Lloyd Zusman wrote:

> I'm sure I can do this adaptation, although I certainly wouldn't mind
> some postgress-specific docs for 2.3.x, if such things exist.

I wrote the SQL stuff to be fairly generic, and I know it works on
both MySQL and PosygreSQL in its current form.  You shouldn't have to
worry about database-specific issues at all.
 
> However, there's a trickier database-related problem that I haven't
> been able to figure out.  Consider the following excerpt from
> imp/config/conf.php:
> 
>   // What preferences driver should we use? Valid values are 'none'
>   // (meaning use system defaults and don't save any user preferences),
>   // 'Session' (preferences only persist during the login), 'LDAP', 
>   // and 'SQL'.
>   $conf['prefs']['driver'] = 'SQL';
> 
>   // Any parameters that the preferences driver needs. This includes
>   // database or ldap server, username/password to connect with, etc.
>   $conf['prefs']['params'] = array();
>   // ?????????????????????????????????????????
> 
> As you can see, I want to use SQL for my preferences driver.  But how
> do I find out the precise values to use for $conf['prefs']['params']
> for my particular choice of database, which as I mentioned above is
> PostgresSql?  I couldn't find any documentation for this anywhere.

>From the header comment of horde/lib/Prefs/SQL.php (admitted not the
best place to look for setup documentation):

/**
 * Preferences storage implementation for PHP's PEAR database abstraction
 * layer.
 *
 * Required values for $params:
 *      'phptype'       The database type (ie. 'pgsql', 'mysql, etc.).
 *      'hostspec'      The hostname of the database server.
 *      'username'      The username with which to connect to the database.
 *      'password'      The password associated with 'username'.
 *      'database'      The name of the database.
 *      'table'         The name of the preferences table in 'database'.
 *
 * Required by some database implementations:
 *      'options'       Additional options to pass to the database.
 *      'tty'           The TTY on which to connect to the database.
 *      'port'          The port on which to connect to the database.
 *
 * The table structure for the preferences is as follows:
 *
 *  create table user_webmail_prefs (
 *      uid             char(32) not null,
 *      pref_name       char(32) not null,
 *      pref_value      text null,
 *      primary key (uid, pref_name)
 *  );
 *
 * @author  Jon Parise <jon@csh.rit.edu>
 * @version $Revision: 1.21 $
 * @since   Horde 1.3
 * @package horde.prefs
 */

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member