Debug.php 668 Bytes
<?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(array('\Hood\Debug\HoodException', 'exceptionHandler'));
    }


    static public function handler()
    {
        self::errorHandler();
        self::exceptionHandler();
    }
}