本文整理汇总了PHP中log::init方法的典型用法代码示例。如果您正苦于以下问题:PHP log::init方法的具体用法?PHP log::init怎么用?PHP log::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log
的用法示例。
在下文中一共展示了log::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dl_recharge
function dl_recharge($AppId)
{
log::init('./log', 'dl_log');
$uri = $_SERVER['REQUEST_URI'];
log::instance()->debug("new con: {$uri}");
$config = (include "config.php");
$pf_info = $config["dl"][$AppId];
$str = "order=" . stripslashes($_GET["order"]) . "&money=" . stripslashes($_GET["money"]) . "&mid=" . stripslashes($_GET["mid"]) . "&time=" . stripslashes($_GET["time"]) . "&result=" . stripslashes($_GET["result"]) . "&ext=" . stripslashes($_GET["ext"]) . "&key=" . $pf_info["AppKey"];
$sign = strtolower(md5($str));
if ($sign != stripslashes($_GET["signature"])) {
log::instance()->error("ret: 签名无效");
exit;
}
echo "success";
$note = json_decode(stripslashes($_GET["ext"]), true);
$ret = recharge($pf_info["PF"], $note["sid"], $note["odr"], $note["uid"], $note["item"], stripslashes($_GET["money"]), stripslashes($_GET["order"]), 0);
log::instance()->debug("ret: " . $ret);
if ($ret != "SUCCESS" && $ret != "TRADE_NO NOT EXIST") {
$str = "app_id={$AppId}" . "&mid=" . stripslashes($_GET["mid"]) . "&order_no=" . stripslashes($_GET["order"]) . "&key=" . $pf_info["AppKey"];
$sign = strtolower(md5($str));
$url = "http://connect.d.cn/open/pay-async/refund" . "?app_id=" . urlencode($AppId) . "&mid=" . urlencode(stripslashes($_GET["mid"])) . "&order_no=" . urlencode(stripslashes($_GET["order"])) . "&sig=" . urlencode($sign);
$response = file_get_contents($url);
log::instance()->debug("refund: order:" . stripslashes($_GET["order"]) . " ret:{$response}");
}
}
示例2: append
/**
* Record Exception
+-----------------------------------------
* @access public
* @param Exception $e
* @return void
*/
static function append($e)
{
// log
$message = $e->getMessage() . ' File:' . $e->getFile() . ' Line:' . $e->getLine();
if (DEBUG) {
debug::log($message, 'Warning');
$message .= "\n" . $e->getTraceAsString();
}
$code = is_a($e, 'ErrorException') ? $e->getSeverity() : $e->getCode();
log::init()->write($message, $code, get_class($e));
self::$_exception[] = $e;
}
示例3: mz_recharge
function mz_recharge($AppId)
{
log::init('./log', 'mz_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$config = (include "config.php");
$pf_info = $config["mz"][$AppId];
$str = stripslashes($_POST["username"]) . "|" . stripslashes($_POST["change_id"]) . "|" . stripslashes($_POST["money"]) . "|" . $pf_info["AppKey"];
$sign = stripslashes($_POST["hash"]);
if (strtolower(md5($str)) != $sign) {
log::instance()->error("ret: 签名无效");
echo "0";
exit;
}
$note = json_decode(stripslashes($_POST["object"]), true);
$ret = recharge($pf_info["PF"], $note["sid"], $note["odr"], $note["uid"], $note["item"], stripslashes($_POST["money"]), stripslashes($_POST["change_id"]), 0);
log::instance()->debug("ret: " . $ret);
if ($ret == "SUCCESS" || $ret == "TRADE_NO NOT EXIST") {
echo "1";
} else {
echo "0";
}
}
示例4: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "ssl.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'pp_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$pf_info = $config["pp"][stripslashes($_POST["app_id"])];
$sign = base64_decode(stripslashes($_POST["sign"]));
$source = json_decode(publickey_decodeing($sign, $pf_info["PubKey"]), true);
if (empty($source) || $source["order_id"] != stripslashes($_POST["order_id"]) || $source["billno"] != stripslashes($_POST["billno"]) || $source["account"] != stripslashes($_POST["account"]) || $source["amount"] != stripslashes($_POST["amount"]) || $source["status"] != stripslashes($_POST["status"]) || $source["app_id"] != stripslashes($_POST["app_id"]) || $source["uuid"] != stripslashes($_POST["uuid"]) || $source["roleid"] != stripslashes($_POST["roleid"]) || $source["zone"] != stripslashes($_POST["zone"])) {
log::instance()->error("ret: 签名无效");
echo "fail";
exit;
}
if ($source["status"] == 1) {
log::instance()->error("ret: status 为已兑换过并成功返回");
echo "success";
exit;
}
$note = json_decode(base64_decode(stripslashes($_POST["roleid"])), true);
$ret = recharge($pf_info["PF"], stripslashes($_POST["zone"]), stripslashes($_POST["billno"]), $note["uid"], $note["item"], stripslashes($_POST["amount"]), stripslashes($_POST["order_id"]), 0);
log::instance()->debug("ret: " . $ret);
if ($ret == "SUCCESS" || $ret == "TRADE_NO NOT EXIST") {
echo "success";
} else {
echo "fail";
示例5: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "ssl.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'itools_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$AppID = "533";
$pf_info = $config["itools"][$AppID];
// RSA verify
$notify_data = base64_decode(stripslashes($_POST["notify_data"]));
$notify_data = publickey_decodeing_sectionalized($notify_data, 128, $pf_info["PubKey"]);
$sign = base64_decode(stripslashes($_POST["sign"]));
if (!rsa_verify($notify_data, $sign, $pf_info["PubKey"])) {
log::instance()->error("ret: 签名无效");
echo "fail";
exit;
}
// end verify
echo "success";
$notify_data = json_decode($notify_data, true);
if ($notify_data["result"] != "success") {
log::instance()->error("ret: 支付失败");
exit;
}
$note = json_decode(base64_decode($notify_data["order_id_com"]), true);
$ret = recharge($pf_info["PF"], $note["sid"], $note["odr"], $note["uid"], $note["item"], $notify_data["amount"], $notify_data["order_id"], 0);
示例6: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "ssl.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'wdj_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$AppID = "100013257";
$pf_info = $config["wdj"][$AppID];
// RSA verify
$content = stripslashes($_POST["content"]);
$sign = base64_decode(stripslashes($_POST["sign"]));
$pem = chunk_split($pf_info["PubKey"], 64, "\n");
$pubkey = "-----BEGIN PUBLIC KEY-----\n" . $pem . "-----END PUBLIC KEY-----";
if (!rsa_verify($content, $sign, $pubkey)) {
log::instance()->error("ret: 签名无效");
echo "fail";
exit;
}
// end verify
$content = json_decode($content, true);
$note = json_decode($content["out_trade_no"], true);
$ret = recharge($pf_info["PF"], $note["sid"], $note["odr"], $note["uid"], $note["item"], $content["money"] / 100, $content["orderId"], 0);
log::instance()->debug("ret: " . $ret);
if ($ret == "SUCCESS" || $ret == "TRADE_NO NOT EXIST") {
echo "success";
} else {
示例7: header
<?php
include_once "log.php";
include_once "recharge.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', '360_log');
$uri = $_SERVER['REQUEST_URI'];
log::instance()->debug("new con: {$uri}");
$AppId = "201932111";
$pf_info = $config["360"][$AppId];
$param = $_GET;
ksort($param);
$str = "";
foreach ($param as $key => $value) {
if ($key != "sign" && $key != "sign_return") {
$str = $str . stripslashes($value) . "#";
}
}
$str = $str . $pf_info["AppSec"];
$sign = strtolower(md5($str));
if ($sign != stripslashes($_GET["sign"])) {
log::instance()->error("ret: 签名无效");
exit;
}
echo "ok";
if (stripslashes($_GET["gateway_flag"]) != "success") {
log::instance()->error("ret: 支付失败");
exit;
}
$note = json_decode(stripslashes($_GET["app_ext1"]), true);
示例8: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "lx_tools/IappDecrypt.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'lx_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$transdata = stripslashes($_POST["transdata"]);
$sign = stripslashes($_POST["sign"]);
$data = json_decode($transdata, true);
$pf_info = $config["lx"][$data["appid"]];
$tools = new IappDecrypt();
if ($tools->validsign($transdata, $sign, $pf_info["AppKey"]) != 0) {
log::instance()->error("ret: 签名无效");
echo "FAILED";
exit;
}
if ($data["result"] != 0) {
log::instance()->error("ret: 支付失败");
echo "SUCCESS";
exit;
}
list($trade_no, $sid, $uid, $item) = split(",", $data["cpprivate"]);
$ret = recharge($pf_info["PF"], $sid, $data["exorderno"], $uid, $item, $data["money"] / 100, $data["transid"], 0);
log::instance()->debug("ret: " . $ret);
if ($ret == "SUCCESS" || $ret == "TRADE_NO NOT EXIST") {
echo "SUCCESS";
示例9: header
<?php
include_once "log.php";
include_once "recharge.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'uc_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$body = json_decode(urldecode($body), true);
if (!isset($body["data"])) {
log::instance()->error("ret: 无效请求");
echo "FAILURE";
exit;
}
$pf_info = $config["uc"][$body["data"]["gameId"]];
ksort($body["data"]);
$str = $pf_info["cpId"];
foreach ($body["data"] as $key => $value) {
$str = "{$str}{$key}={$value}";
}
$str = $str . $pf_info["AppKey"];
$sign = strtolower(md5($str));
if ($body["sign"] != $sign) {
log::instance()->error("ret: 签名无效");
echo "FAILURE";
exit;
}
echo "SUCCESS";
if ($body["data"]["orderStatus"] == 'F') {
示例10: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "tx_tools/SnsSigCheck.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'tencent_log');
$uri = $_SERVER['REQUEST_URI'];
$method = strtoupper($_SERVER['REQUEST_METHOD']);
if ("GET" == $method) {
$params = $_GET;
} else {
if ("POST" == $method) {
$body = file_get_contents('php://input');
$params = $_POST;
}
}
log::instance()->debug("new con: {$uri} {$body}");
$pf_info = $config["tencent"][stripslashes($params["appid"])];
$api = substr($uri, 0, strcspn($uri, '?'));
if (!SnsSigCheck::verifySig($method, $api, $params, $pf_info["AppKey"] . '&', $params["sig"])) {
log::instance()->error("ret: 签名无效");
$obj->ret = 4;
$obj->msg = "签名无效";
echo json_encode($obj);
exit;
}
$just_record = true;
if ($just_record) {
$ret = "SUCCESS";
示例11: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "ssl.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'hw_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$AppID = "10192320";
$pf_info = $config["hw"][$AppID];
// RSA verify
$params = $_POST;
ksort($params);
$str = "";
foreach ($params as $key => $value) {
if ($key == "sign") {
continue;
}
if (strlen($str) == 0) {
$str = $key . "=" . stripslashes($value);
} else {
$str = $str . "&" . $key . "=" . stripslashes($value);
}
}
$sign = base64_decode(stripslashes($_POST["sign"]));
$pubkey = "-----BEGIN PUBLIC KEY-----\r\n" . chunk_split($pf_info["PubKey"], 64, "\r\n") . "-----END PUBLIC KEY-----";
if (!rsa_verify($str, $sign, $pubkey)) {
log::instance()->error("ret: 签名无效");
示例12: header
<?php
include_once "log.php";
include_once "recharge.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'tbt_log');
$uri = $_SERVER['REQUEST_URI'];
log::instance()->debug("new con: {$uri}");
$pf_info = $config["tb"][stripslashes($_GET["partner"])];
$str = "source=" . stripslashes($_GET["source"]) . "&trade_no=" . stripslashes($_GET["trade_no"]) . "&amount=" . stripslashes($_GET["amount"]) . "&partner=" . stripslashes($_GET["partner"]) . "&paydes=" . stripslashes($_GET["paydes"]) . "&debug=" . stripslashes($_GET["debug"]) . "&tborder=" . stripslashes($_GET["tborder"]) . "&key=" . $pf_info["AppKey"];
$sign = strtolower(md5($str));
if ($sign != stripslashes($_GET["sign"])) {
log::instance()->error("ret: 签名无效");
exit;
}
$note = json_decode(stripslashes($_GET["paydes"]), true);
$ret = recharge($pf_info["PF"], $note["sid"], stripslashes($_GET["trade_no"]), $note["uid"], $note["item"], stripslashes($_GET["amount"]) / 100, stripslashes($_GET["tborder"]), stripslashes($_GET["debug"]));
log::instance()->debug("ret: " . $ret);
if ($ret == "SUCCESS" || $ret == "TRADE_NO NOT EXIST") {
$obj->status = 'success';
echo json_encode($obj);
}
示例13: header
<?php
include_once "log.php";
include_once "recharge.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'mi_log');
$uri = $_SERVER['REQUEST_URI'];
log::instance()->debug("new con: {$uri}");
$pf_info = $config["mi"][stripslashes($_GET["appId"])];
if (!isset($pf_info)) {
log::instance()->error("ret: 找不到配置");
echo "{\"errcode\":1515}";
exit;
}
$param = $_GET;
ksort($param);
$str = "";
foreach ($param as $key => $value) {
if ($key == "signature" || !isset($value)) {
continue;
}
if (strlen($str) == 0) {
$str = "{$key}=" . stripslashes($value);
} else {
$str .= "&{$key}=" . stripslashes($value);
}
}
$sign = hash_hmac('sha1', $str, $pf_info["AppSec"]);
if ($sign != stripslashes($_GET["signature"])) {
log::instance()->error("ret: 签名无效");
示例14: header
<?php
include_once "log.php";
include_once "recharge.php";
include_once "tx_tools/OpenApiV3.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'qq_log');
$uri = $_SERVER['REQUEST_URI'];
$method = strtoupper($_SERVER['REQUEST_METHOD']);
if ("GET" == $method) {
$params = $_GET;
} else {
if ("POST" == $method) {
$body = file_get_contents('php://input');
$params = $_POST;
}
}
log::instance()->debug("new con: {$uri} {$body}");
$appid = '1102506911';
$pf_info = $config["tencent"][$appid];
$openApi = new OpenApiV3($appid, $pf_info['AppKey']);
$openApi->setServerName('openapi.tencentyun.com');
// 查询余额
$pay_params = array('openid' => $params['openid'], 'openkey' => $params['openkey'], 'pay_token' => $params['pay_token'], 'ts' => time(), 'pf' => $params['pf'], 'zoneid' => $params['zoneid'], 'pfkey' => $params['pfkey']);
$pay_cookie = array('session_id' => 'openid', 'session_type' => 'kp_actoken', 'org_loc' => '/mpay/get_balance_m');
$result = $openApi->api($pay_cookie['org_loc'], $pay_params, $pay_cookie, 'GET', 'https');
$result['msg'] = urlencode($result['msg']);
$response = array('type' => 1, 'ret' => $result['ret']);
if ($result['ret'] !== 0) {
log::instance()->error("ret: 查询失败 " . urldecode(json_encode($result)));
示例15: header
<?php
include_once "log.php";
include_once "recharge.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'apple_log');
$uri = $_SERVER['REQUEST_URI'];
$body = file_get_contents('php://input');
log::instance()->debug("new con: {$uri} {$body}");
$body = json_decode(urldecode($body), true);
//$url = "https://buy.itunes.apple.com/verifyReceipt";
$url = "https://sandbox.itunes.apple.com/verifyReceipt";
$receipt = json_encode(array("receipt-data" => $body["receipt-data"]));
$response = sendPostData($url, $receipt);
$content = json_decode($response['content'], true);
if ($content["status"] !== 0) {
log::instance()->error("ret: 验证失败 errCode:" . $content["status"]);
echo "fail";
exit;
}
$pf_info = $config["apple"]["appstore"];
$note = $content["receipt"];
$ret = recharge($pf_info["PF"], $body["sid"], $body["odr"], $body["uid"], $note["product_id"], "apple", $note["transaction_id"], 0);
log::instance()->debug("ret: " . $ret);
if ($ret == "SUCCESS" || $ret == "TRADE_NO NOT EXIST") {
echo "success";
} else {
echo "fail";
}
function sendPostData($url, $data)