Home » Memorandum » XOOPS » Cube2.1 Info » XoopsErrorHandler in Xoops Cube Legacy2.1

XoopsErrorHandler in Xoops Cube Legacy2.1

flagflag

GIJOE wrote in his site [Starting to debug Cube 2.1beta], he don't want to use XoopsErrorHandler and he directly commented out some lines in class/errorhandler.php.
But with XOOP Cube Legacy 2.1 beta, anyone who don't want using XoopsErrorHandler, he can override this portion using with Delagete function.
You can create a new file /preload/DisableErrorHandler.class.php and fill following lines.



<?php
class DisableErrorHandler extends XCube_ActionFilter
{
    function 
preFilter() {
        
$this->mController->mSetupDebugger->reset();
        
$this->mController->mSetupDebugger->add('My_DebuggerManager::createInstance');
    }
}
    
class 
My_DebuggerManager extends Legacy_DebuggerManager
{
    function 
createInstance(&$instance$debug_mode)
    {
        if (
is_object($instance)) {
            return;
        }
    
        switch(
$debug_mode) {
            case 
XOOPS_DEBUG_PHP:
                
$instance = new My_PHPDebugger();
                break;
    
            case 
XOOPS_DEBUG_MYSQL:
                
$instance = new My_MysqlDebugger();
                break;
    
            case 
XOOPS_DEBUG_SMARTY:
                
$instance = new My_SmartyDebugger();
                break;
    
            case 
XOOPS_DEBUG_OFF:
            default:
                
$instance = new Legacy_NonDebugger();
                break;
        }
    }
}
    
class 
My_PHPDebugger extends Legacy_PHPDebugger
{
    function 
prepare()
    {
        
error_reporting(E_ALL);
        
$GLOBALS['xoopsErrorHandler'] = null;
    }
}
    
class 
My_MysqlDebugger extends Legacy_MysqlDebugger
{
    function 
prepare()
    {
        
$GLOBALS['xoopsErrorHandler'] = null;
    }
}
    
class 
My_SmartyDebugger extends Legacy_SmartyDebugger
{
    function 
prepare()
    {
        
$GLOBALS['xoopsErrorHandler'] = null;
    }
}
?>


Comments

RSS feed for comments on this post.

  1. Almost same content has been written by minahito at How to prevent XoopsErrorHandler

    Comment by nobunobu — 2006年11月12日(Sunday) @ 11時18分46秒

Leave a Comment

Sorry, the comment form is closed at this time.


30 queries. 0.018 sec.
Powered by WordPress Module based on WordPress ME & WordPress

flagflag

XOOPS初心者サーチ


Add to Google

Xoops Cube Project

XOOPS Cube Project Site

XC Developers Ring

http://img.simpleapi.net/small/http://www.peak.ne.jp/xoops/ SIZE:128x128(7.6KB)