Debug.php
659 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Created by PhpStorm.
* User: Zip
* Date: 14/12/9
* Time: 下午10:32
*/
namespace Hood;
use Hood\Debug\ErrorHandler;
use Hood\Debug\ExceptionHandler;
class Debug
{
/**
* @return ErrorHandler
*/
static public function errorHandler()
{
set_error_handler(array('\Hood\Debug\HoodError', 'errorHandler'));
}
/**
* @return ExceptionHandler
*/
static public function exceptionHandler()
{
set_exception_handler('\Hood\Debug\HoodException::exceptionHandler');
}
static public function handler()
{
self::errorHandler();
self::exceptionHandler();
}
}