Minahito
minah****@users*****
2005年 12月 26日 (月) 18:07:36 JST
Index: xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php diff -u xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.5 xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.6 --- xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php:1.1.2.5 Tue Nov 29 16:15:33 2005 +++ xoops2jp/html/modules/base/kernel/Legacy_Controller.class.php Mon Dec 26 18:07:36 2005 @@ -71,9 +71,19 @@ $this->mRoot->ModifierManager->addModifier($modifier); } + function _setupLogger() + { + require_once XOOPS_ROOT_PATH.'/class/logger.php'; + $this->mLogger=&XoopsLogger::instance(); + $this->mLogger->startTime(); + + $GLOBALS['xoopsLogger']=&$this->mLogger; + } + function _setupEnvironment() { parent::_setupEnvironment(); + require_once XOOPS_ROOT_PATH."/include/version.php"; require_once XOOPS_ROOT_PATH."/settings/definition.inc.php"; define("XOOPS_BASE_PATH",XOOPS_MODULE_PATH."/".XOOPS_BASE_PROC_NAME); @@ -254,14 +264,11 @@ function _setupErrorHandler() { - parent::_setupErrorHandler(); - $GLOBALS['xoopsErrorHandler']=&$this->mErrorHandler; - } + require_once XOOPS_ROOT_PATH.'/class/errorhandler.php'; + $this->mErrorHandler=&XoopsErrorHandler::getInstance(); + $this->mErrorHandler->activate(true); - function _setupLogger() - { - parent::_setupLogger(); - $GLOBALS['xoopsLogger']=&$this->mLogger; + $GLOBALS['xoopsErrorHandler']=&$this->mErrorHandler; } /** @@ -270,13 +277,29 @@ */ function _setupDB() { - parent::_setupDB(); + if(!defined('XOOPS_XMLRPC')) + define('XOOPS_DB_CHKREF', 1); + else + define('XOOPS_DB_CHKREF', 0); + + require_once XOOPS_ROOT_PATH.'/class/database/databasefactory.php'; + + if ($_SERVER['REQUEST_METHOD'] != 'POST' || !xoops_refcheck(XOOPS_DB_CHKREF)) { + define('XOOPS_DB_PROXY', 1); + } + + $this->mDB =& XoopsDatabaseFactory::getDatabaseConnection(); + $GLOBALS['xoopsDB']=&$this->mDB; } function _setupConfig() { - parent::_setupConfig(); + $configHandler=&xoops_gethandler('config'); + $this->mConfig=&$configHandler->getConfigsByCat(XOOPS_CONF); + + $this->mRoot->setThemeName($this->mConfig['theme_set']); + $GLOBALS['xoopsConfig']=&$this->mConfig; } @@ -286,17 +309,44 @@ */ function _setupDebugger() { - parent::_setupDebugger(); + error_reporting(0); + + require_once XOOPS_BASE_PATH."/class/debug/XoopsDebugManager.class.php"; + + $debug_mode = $this->mConfig['debug_mode']; + if(defined("OH_MY_GOD_HELP_ME")) + $debug_mode = XOOPS_DEBUG_PHP; + + $this->mDebugger=&XoopsDebuggerManager::getInstance($this->mConfig['debug_mode']); + $this->mDebugger->setup(); + $GLOBALS['xoopsDebugger']=&$this->mDebugger; } - + + function _setupSession() + { + global $xoopsDB; + + $sessionHandler=&xoops_gethandler('session'); + + session_set_save_handler( + array(&$sessionHandler,"open"), + array(&$sessionHandler,"close"), + array(&$sessionHandler, 'read'), + array(&$sessionHandler, 'write'), + array(&$sessionHandler, 'destroy'), + array(&$sessionHandler, 'gc')); + + session_start(); + } + function &_createLanguageManager() { global $xoopsOption; - require_once XOOPS_BASE_PATH."/class/Base_LegacyLanguageManager.class.php"; + require_once XOOPS_BASE_PATH."/kernel/Legacy_LanguageManager.class.php"; - $languageManager = new Base_LegacyLanguageManager($this->mConfig['language']); + $languageManager =& new Legacy_LanguageManager($this->mConfig['language']); $languageManager->loadMainLanguage(); // If you use special page, load message catalog for it.