make this a tiny bit cleaner

This commit is contained in:
seek3r 2001-02-09 03:21:57 +00:00
parent ea94c3fa4d
commit b88aeb3515
2 changed files with 15 additions and 15 deletions

View File

@ -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));

View File

@ -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