Creation of gcm_input and a first approach to a web interface
[gnucomo.git] / src / phpclasses / gnucomo_config.php
1 <?php
2
3 require_once('configuration.class.php');
4
5 /*
6 ///////////////////////////////////////////////////////////////////////////
7 //  NAME           : gnucomo_config
8 //  BASECLASS      : configuration
9 //  MEMBERS        :
10 //  OPERATORS      :
11 //  METHODS        : Database - Obtain the database access string
12 //
13 //  DESCRIPTION    : 
14 //
15 //  RELATIONS      :
16 //  SEE ALSO       :
17 //  LAST MODIFIED  :
18 ///////////////////////////////////////////////////////////////////////////
19 */
20
21 class gnucomo_config extends configuration
22 {
23
24    // Return the database access string.
25
26    function Database()
27    {
28       $access_string = "";
29
30       $param = $this->find_parameter("database", "name");
31       if ($param != "")
32       {
33          $access_string .= "dbname=" . $param;
34       }
35
36       $param = $this->find_parameter("database", "user");
37       if ($param != "")
38       {
39          $access_string .= " user=" . $param;
40       }
41
42       $param = $this->find_parameter("database", "password");
43       if ($param != "")
44       {
45          $access_string .= " password=" . $param;
46       }
47
48       $param = $this->find_parameter("database", "host");
49       if ($param != "")
50       {
51          $access_string .= " host=" . $param;
52       }
53
54       $param = $this->find_parameter("database", "port");
55       if ($param != "")
56       {
57          $access_string .= " port=" . $param;
58       }
59       return $access_string;
60    }
61 };
62 ?>