<?php ob_start(); define("_SEP_", DIRECTORY_SEPARATOR); define("_DEBUG_", true); require_once 'autoloader.php'; require_once 'errorHandler.php'; require_once ".." . _SEP_ . "classes" . _SEP_ . "library" . _SEP_ . 'firePHP' . _SEP_ . "fb.php"; NewDao::connect('mysql', ".." . _SEP_ . "configs" . _SEP_ . "db.ini"); NewDao::setLogger(array('FB', 'log')); TreeForumAutoload('TFUserM'); session_start(); session_regenerate_id(); $conf = new IniObject(".." . _SEP_ . "configs" . _SEP_ . "view.ini"); TFRouter::route($conf->base_path, '', $conf); ob_flush();
/** * a factory method for singelton pattern * @access public * @return TFUser * @static */ public static function getInstance() { if (self::$_instance instanceof TFUserM) { return self::$_instance; } if (!isset($_SESSION)) { session_start(); session_regenerate_id(); } if (isset($_SESSION['TFUser'])) { TreeForumAutoload('TFUserM'); if ($_SESSION['TFUser'] instanceof TFUserM) { self::$_instance = $_SESSION['TFUser']; self::$_id = self::$_instance->getId(); } else { self::$_id = self::DEF_ID; } } else { self::$_id = self::DEF_ID; self::regenerate(); } return self::$_instance; }
function __autoload($class_name) { TreeForumAutoload($class_name); }