From b88aeb351510457626526d143fea69e20f029368 Mon Sep 17 00:00:00 2001 From: seek3r Date: Fri, 9 Feb 2001 03:21:57 +0000 Subject: [PATCH] make this a tiny bit cleaner --- phpgwapi/inc/class.phpgw.inc.php | 27 ++++++++++++++------------- phpgwapi/inc/functions.inc.php | 3 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/phpgwapi/inc/class.phpgw.inc.php b/phpgwapi/inc/class.phpgw.inc.php index a0e5f3476e..2dc947bf66 100644 --- a/phpgwapi/inc/class.phpgw.inc.php +++ b/phpgwapi/inc/class.phpgw.inc.php @@ -57,7 +57,20 @@ // You could redirect them to login.php with code 2 or use the default // I recommend using the default until all of the bugs are worked out. - function phpgw_() + function phpgw() { + global $phpgw_info; + $this->db = CreateObject("phpgwapi.db"); + $this->db->Host = $phpgw_info["server"]["db_host"]; + $this->db->Type = $phpgw_info["server"]["db_type"]; + $this->db->Database = $phpgw_info["server"]["db_name"]; + $this->db->User = $phpgw_info["server"]["db_user"]; + $this->db->Password = $phpgw_info["server"]["db_pass"]; + if ($this->debug) { + $this->db->Debug = 1; + } + } + + function load_core_objects() { /************************************************************************\ * Required classes * @@ -77,18 +90,6 @@ * Core functions * \**************************************************************************/ - function load_db() { - global $phpgw_info; - $this->db = CreateObject("phpgwapi.db"); - $this->db->Host = $phpgw_info["server"]["db_host"]; - $this->db->Type = $phpgw_info["server"]["db_type"]; - $this->db->Database = $phpgw_info["server"]["db_name"]; - $this->db->User = $phpgw_info["server"]["db_user"]; - $this->db->Password = $phpgw_info["server"]["db_pass"]; - if ($this->debug) { - $this->db->Debug = 1; - } - } function strip_html($s) { return htmlspecialchars(stripslashes($s)); diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 74e51b1116..d7430c0ec9 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -185,7 +185,6 @@ \****************************************************************************/ /* Load main class */ $phpgw = CreateObject("phpgwapi.phpgw"); - $phpgw->load_db(); /* Fill phpgw_info["server"] array */ $phpgw->db->query("select * from phpgw_config",__LINE__,__FILE__); @@ -193,7 +192,7 @@ $phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value")); } - $phpgw->phpgw_(); + $phpgw->load_core_objects(); print_debug('main class loaded'); // Handy little shortcut