Home »  » 2006 » November » 04

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

Leave a Comment

Sorry, the comment form is closed at this time.


18 queries. 0.028 sec.
Powered by WordPress Module based on WordPress ME & WordPress

flagflag

Main Menu

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)