*/ require_once("../include/Config.inc"); #require_once("../include/DB.inc"); require_once("../include/Messages.inc"); require_once("../include/Session.inc"); require_once("../include/User.inc"); class Name_space { var $have_database = false; var $have_session = false; var $have_user = false; var $config = false; var $database = false; var $messages = false; var $session = false; var $user = false; function Name_space($options = array()) { if ($options['have_database']) $this->have_database = $options['have_database']; if ($options['have_session']) $this->have_session = $options['have_session']; if ($options['have_user']) $this->have_user = $options['have_user']; $this->config = new Config() or die("Count not create config object"); $this->messages = new Messages or die("Could not create messages object"); if ($this->have_database) $this->database = new Database ( $this->config->db_type, $this->config->db_host, $this->config->db_user, $this->config->db_password, $this->config->db_name) or die("Could not create database object"); if ($this->have_session) $this->session = new Session( $this->database, $this->config->session_cookie_name, $this->messages ) or die("Could not create session object"); if ($this->have_user) $this->user = new User( $this->database, $this->session, $this->config->auth_timeout ) or die("Could not create user object"); } function stop() { if ($this->have_session) { assert($this->session); $this->session->close(); } } } # vim:set ts=4: # vim:set shiftwidth=4: ?>