lithium\core\ErrorHandler::config PHP Method

config() public static method

Configure the ErrorHandler.
public static config ( array $config = [] ) : Current
$config array Configuration directives.
return Current configuration set.
    public static function config($config = array())
    {
        return static::$_config = array_merge($config, static::$_config);
    }

Usage Example

Beispiel #1
0
 public function testErrorCatching()
 {
     $self = $this;
     ErrorHandler::config(array(array('code' => E_WARNING | E_USER_WARNING, 'handler' => function ($info) use($self) {
         $self->errors[] = $info;
     })));
     file_get_contents(false);
     $this->assertEqual(1, count($this->errors));
     $result = end($this->errors);
     $this->assertPattern('/Filename cannot be empty/', $result['message']);
     trigger_error('Test warning', E_USER_WARNING);
     $this->assertEqual(2, count($this->errors));
     $result = end($this->errors);
     $this->assertEqual('Test warning', $result['message']);
     trigger_error('Test notice', E_USER_NOTICE);
     $this->assertEqual(2, count($this->errors));
 }
All Usage Examples Of lithium\core\ErrorHandler::config