示例#1
0
 public static function setError($errCode, $errMsg)
 {
     self::$errCode = $errCode;
     self::$errMsg = $errMsg;
     //保存下错误.
     $str = 'errCOde=' . $errCode . ';errMsg=' . $errMsg . ';';
     $arr = array($_GET, $_POST);
     Factory::getSystemLog()->push($str, $arr);
 }
示例#2
0
 /**
  * 错误监听
  */
 public static function errorHandler($errno, $errstr, $errfile, $errline)
 {
     $err_msg = "信息:{$errno}。内容:{$errstr},发生在文件{$errfile}的{$errline}行";
     switch ($errno) {
         case E_ERROR:
         case E_PARSE:
         case E_CORE_ERROR:
         case E_COMPILE_ERROR:
         case E_USER_ERROR:
             break;
         default:
             # code...
             break;
     }
     Factory::getSystemLog('php')->push($err_msg);
     return true;
 }
示例#3
0
    /**
     * 查看会员信息
     */
    public function getMemberCardUserInfo($data) {
        $url = sprintf(self::get_member_card_user_info, $this->_token);
        $json = code_unescaped($data);
        $result = WeiXinApiRequest::post($url, $json, false, false);
        // 写入系统日志
        $this->_debug && Factory::getSystemLog()->push("getMemberCardUserInfo  拉取会员信息(积分查询)接口:", array(
                    'data' => $data,
                    'json' => $json,
                    'result' => $result
        ));

        if ($result ['errcode'] != 0) {
            $this->error = array(
                'errcode' => $result ['errcode'],
                'errmsg' => $result ['errmsg']
            );
            return $this->error;
        }
        return $result;
    }
示例#4
0
<?php
set_time_limit(0);
define("LIB_PATH", dirname(__FILE__));
define("APP_NAME", 'HuiShi');
error_reporting(E_ALL);
ini_set("display_errors", true);
date_default_timezone_set('PRC');

include_once LIB_PATH . '/../../SuiShiPHP/SuiShiPHP.class.php';
include_once LIB_PATH . '/../../SuiShiPHP/Log/SystemLog.class.php';
include_once LIB_PATH . '/../../SuiShiPHP/Cache/RedisCache.class.php';
include_once LIB_PATH . '/Common/String.class.php';
include_once LIB_PATH . '/Config/Config.php';
//include_once LIB_PATH . '/Config/Define.Config.php';
include_once LIB_PATH . '/Common/Function.php';
include_once LIB_PATH . '/Common/Page.class.php';
include_once LIB_PATH . '/Common/Image.class.php';

SuiShiPHP::init(Config::$_CONFIGS);

Factory::getSystemLog()->start();
Factory::getSystemLog()->push("http param", HttpRequest::get());
示例#5
0
 private function setError()
 {
     $str = $this->sql . '. error: ' . var_export($this->db->errorInfo(), true);
     Factory::getSystemLog('sql')->push($str);
 }
示例#6
0
/**
 * 终止程序函数
 */
function myExit($msg = '') {
	//TODO 处理终止前程序
	Factory::getSystemLog()->flush();
	if ($msg) echo $msg;
	exit();
}
示例#7
0
	public function code_info($code, $card_id) {
		$url = sprintf(self::code_info, $this->token);
		
		$json = code_unescaped(array('code'=>$code, 'card_id'=>$card_id));
		$result = WeiXinApiRequest::post($url, $json, false, false);
		
		//写入系统日志
		$this->debug && Factory::getSystemLog()->push("CardPacket code_info获取卡券领取信息:", array('code'=>$code, 'card_id'=>$card_id, 'result'=>$result));
		
		if($result['errcode']==0){
			return $result['openid'];
		}
		
		return FALSE;
	}
示例#8
0
 /**
  * 退出中断程序
  */
 private function _exit($str = '', $data = null)
 {
     if (!empty($str)) {
         Factory::getSystemLog('wx_log')->push('system error' . $str, $data);
     }
     exit;
 }