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 require_once('configuration.class.php');
11 ///////////////////////////////////////////////////////////////////////////
12 // NAME : gnucomo_config
13 // BASECLASS : configuration
16 // METHODS : Database - Obtain the database access string
18 // DESCRIPTION : Provides Gnucomo-specific configuration functions
22 // LAST MODIFIED : Nov 21, 2002
23 ///////////////////////////////////////////////////////////////////////////
26 class gnucomo_config extends configuration
29 // Return the database access string.
31 function Database($usr = "", $pw = "")
35 $param = $this->find_parameter("database", "name");
38 $access_string .= "dbname=" . $param;
43 $param = $this->find_parameter("database", "user");
46 $access_string .= " user=" . $param;
51 $access_string .= " user=" . $usr;
56 $param = $this->find_parameter("database", "password");
59 $access_string .= " password=" . $param;
64 $access_string .= " password=" . $pw;
67 $param = $this->find_parameter("database", "host");
70 $access_string .= " host=" . $param;
73 $param = $this->find_parameter("database", "port");
76 $access_string .= " port=" . $param;
78 return $access_string;