2 /**************************************************************************
3 ** (c) Copyright 2002, Andromeda Technology & Automation
4 ** This is free software; you can redistribute it and/or modify it under the
5 ** terms of the GNU General Public License, see the file COPYING.
6 ***************************************************************************/
8 if (substr(phpversion(), 0, 1) == "4")
10 require_once('configuration.class.php');
14 require_once('configuration.class.php5');
18 ///////////////////////////////////////////////////////////////////////////
19 // NAME : gnucomo_config
20 // BASECLASS : configuration
23 // METHODS : Database - Obtain the database access string
25 // DESCRIPTION : Provides Gnucomo-specific configuration functions
29 // LAST MODIFIED : Nov 21, 2002
30 ///////////////////////////////////////////////////////////////////////////
33 class gnucomo_config extends configuration
36 // Return the database access string.
38 function Database($usr = "", $pw = "")
42 $param = $this->find_parameter("database", "name");
45 $access_string .= "dbname=" . $param;
50 $param = $this->find_parameter("database", "user");
53 $access_string .= " user=" . $param;
58 $access_string .= " user=" . $usr;
63 $param = $this->find_parameter("database", "password");
66 $access_string .= " password=" . $param;
71 $access_string .= " password=" . $pw;
74 $param = $this->find_parameter("database", "host");
77 $access_string .= " host=" . $param;
80 $param = $this->find_parameter("database", "port");
83 $access_string .= " port=" . $param;
85 return $access_string;