コード例 #1
0
ファイル: exception.init.php プロジェクト: pwstrick/grape
 /**
  * record error log
  * @param string $msg
  * @param string $file
  * @param int $line
  * @param string $code
  */
 private static function _recordError($msg, $file, $line, $code)
 {
     $string .= '[' . date('Y-m-d h:i:s') . ']msg:' . $msg . ';file:' . $file . ';line:' . $line . ';code:' . $code . '';
     InitPHP::log($string, ERROR);
     //记录日志
 }
コード例 #2
0
ファイル: run.init.php プロジェクト: pwstrick/grape
 public function handleError($errorCode, $msg = '', $errorFile = 'unkwon', $errorLine = 0)
 {
     $InitPHP_conf = InitPHP::getConfig();
     restore_error_handler();
     if ($errorCode & error_reporting()) {
         InitPHP::log("[error_code]:" . $errorCode . " [msg]:" . $msg, ERROR);
     }
     if ($InitPHP_conf['is_debug'] == true) {
         var_dump($msg);
     } else {
         return InitPHP::return500();
     }
 }