3 /**********************************************************************************
4 ** (c) Copyright 2002, Brenno J.S.A.A.F. de Winter, De Winter Information Soltions
5 ** This is free software; you can redistribute it and/or modify it under the
6 ** terms of the GNU General Public License, see the file COPYING.
7 ***********************************************************************************/
10 function db_select ($inp_dbms) {
11 /* This function delivers some robustness to several names that can be used
12 * for the same database. Multiple names are interpreted as a standard name.
13 * If no valid name has been entered a warning will be given.
15 * - $inp_dbms: name for the DBMS
19 $local_db_input = strtolower(trim($inp_dbms));
20 switch ($local_db_input) {
22 $local_db_type = "postgres";
25 $local_db_type = "postgres";
28 $local_db_type = "postgres";
31 $local_db_type = "postgres";
34 syslog(LOG_WARN, "Invalid DBMS read from config-file");
35 $local_db_type = "xxxxx";
38 if ($local_db_type <> "xxxxx") {
39 require_once ("classes/db.".$local_db_type.".php");
42 function copy_db_class ($inp_class) {
43 /* This function takes a database class, sets the values for the connection,
44 * opens the connection and returns the new cloned class
45 * INPUT : inp_class - Typically a database class
46 * OUTPUT : Class - with cloned database.
49 $new_class = new db();
50 $new_class->db_host = $inp_class->db_host;
51 $new_class->db_name = $inp_class->db_name;
52 $new_class->db_user = $inp_class->db_user;
53 $new_class->db_password = $inp_class->db_password;
54 $new_class->db_connect();