Development

Changeset 17055

You must first sign up to be able to contribute.

Changeset 17055

Show
Ignore:
Timestamp:
04/06/09 18:47:53 (6 years ago)
Author:
fabien
Message:

[1.3] readded PHP errors to the screen in dev mode as the web debug log is broken for now (refs #6210)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/lib/log/sfWebDebugLogger.class.php

    r16942 r17055  
    4747      $dispatcher->connect('response.filter_content', array($this, 'filterResponseContent')); 
    4848    } 
    49      
     49 
    5050    $this->registerErrorHandler(); 
    5151 
    5252    return parent::initialize($dispatcher, $options); 
    5353  } 
    54    
     54 
    5555  /** 
    5656   * Registers logger with PHP error handler. 
    5757   */ 
    5858  protected function registerErrorHandler() 
    59   {     
    60     set_error_handler(array($this,'handlePhpError'));      
     59  { 
     60    set_error_handler(array($this,'handlePhpError')); 
    6161  } 
    62    
     62 
    6363  /** 
    6464   * PHP error handler send PHP errors to log. 
     
    8686      case E_STRICT: 
    8787        $this->dispatcher->notify(new sfEvent($this, 'application.log', array('priority' => sfLogger::ERR, sprintf($message, 'Strict notice')))); 
    88       break; 
     88        break; 
    8989      case E_NOTICE: 
    90         $this->dispatcher->notify(new sfEvent($this, 'application.log', array('priority' => sfLogger::ERR, sprintf($message, 'Notice')))); 
    91       break; 
     90        $this->dispatcher->notify(new sfEvent($this, 'application.log', array('priority' => sfLogger::NOTICE, sprintf($message, 'Notice')))); 
     91        break; 
    9292      case E_WARNING: 
    93         $this->dispatcher->notify(new sfEvent($this, 'application.log', array('priority' => sfLogger::ERR, sprintf($message, 'Warning')))); 
    94       break; 
     93        $this->dispatcher->notify(new sfEvent($this, 'application.log', array('priority' => sfLogger::WARNING, sprintf($message, 'Warning')))); 
     94        break; 
    9595      case E_RECOVERABLE_ERROR: 
    9696        $this->dispatcher->notify(new sfEvent($this, 'application.log', array('priority' => sfLogger::ERR, sprintf($message, 'Error')))); 
    97       break; 
     97        break; 
    9898    } 
    9999 
    100     return true; // prevent default error handling 
     100    return false; // do not prevent default error handling 
    101101  } 
    102102