TriggerError.php 715 Bytes
<?php

namespace WebPlugin;

use WebPlugin\UdpLog;
/**
 * 异常错误日志
 */
class TriggerError
{
 public static function myErrorHandler($errno, $errstr, $errfile, $errline)
 {
//     print_r(get_defined_constants());exit;
     switch ($errno) {
         case \YAF\ERR\NOTFOUND\CONTROLLER:
         case \YAF\ERR\NOTFOUND\MODULE:
         case \YAF\ERR\NOTFOUND\ACTION:
             header("Not Found");
             break;
         default:
             $data['errno'] = $errno;
             $data['errstr'] = $errstr;
             $data['errfile'] = $errfile;
             $data['errline'] = $errline;
             UdpLog::triggerError('triggerError',$data);
             break;
     }
     return true;
 }
}