示例#1
0
 public function pageEntry($inPath)
 {
     /*
      */
     SError::$CONSOLE = true;
     /*
      */
     SError::$LOG = false;
     /*
      */
     SError::$LOGFILE = "/tmp/tmp_serror.log";
     echo $DDJFK;
     function test($B)
     {
         test2($B);
     }
     function test2($a)
     {
         echo "{$B}.{$a}";
         //throw new Exception("D2D");
         //throw new Exception("DD");
     }
     echo "D";
     test("FJKE", "E");
     throw new Exception("DD");
     echo "D";
     //test("B","c");
 }
示例#2
0
 function clear()
 {
     global $SError;
     if (!isset($SError)) {
         SError::create();
     }
     $SError->_errors = array();
     return false;
 }
示例#3
0
 static function error_handler($errno, $errstr, $errfile, $errline)
 {
     if (SError::$CONSOLE) {
         echo SError::getErrorHtml(debug_backtrace());
     }
     if (SError::$LOG) {
         $log = SError::getErrorText(debug_backtrace());
         if (!empty(SError::$LOGFILE)) {
             error_log($log, 3, SError::$LOGFILE);
         } else {
             error_log($log);
         }
     }
 }
 function getErrors()
 {
     return SError::getErrors();
 }
示例#5
0
<?php

/*
 * 是否在前端显示,默认为true
 */
SError::$CONSOLE = true;
/*
 * 是否记log,默认记在error_log记的地方
 */
SError::$LOG = false;
/*
 * 指定log记在文件里,只有用SError::$LOG=true时,这个才有意义
 */
SError::$LOGFILE = "/tmp/tmp_serror.log";
/*
 * 下面是测试代码
 */
echo $DDJFK;
function test($B)
{
    test2($B);
}
function test2($a)
{
    echo "{$B}.{$a}";
    //throw new Exception("D2D");
    //throw new Exception("DD");
}
echo "D";
test("FJKE", "E");
throw new Exception("DD");