本文整理汇总了PHP中log::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP log::instance方法的具体用法?PHP log::instance怎么用?PHP log::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log
的用法示例。
在下文中一共展示了log::instance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
示例2: 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}");
}
}
示例3: i
public static function i($class)
{
if (!isset(self::$instance)) {
$classname = "log_" . $class;
self::$instance = new $classname();
}
return self::$instance;
}
示例4: log
/**
* Short description of method instance
*
* @access public
* @author Jean-Francois Levesque, <jf.levesque@step.polymtl.ca>
* @return void
*/
public static function &instance()
{
if (!log::$instance) {
log::$instance = new log();
log::$instance->init();
}
return log::$instance;
}
示例5: 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";
}
}
示例6: header
include_once "recharge.php";
$config = (include "config.php");
header("Content-type: text/html; charset=utf-8");
log::init('./log', 'dk_log');
$uri = $_SERVER['REQUEST_URI'];
log::instance()->debug("new con: {$uri}");
$AppId = "3491827";
$pf_info = $config["dk"][$AppId];
$str = stripslashes($_GET["amount"]) . stripslashes($_GET["cardtype"]) . stripslashes($_GET["orderid"]) . stripslashes($_GET["result"]) . stripslashes($_GET["timetamp"]) . $pf_info["AppKey"] . urlencode(stripslashes($_GET["aid"]));
$sign = strtolower(md5($str));
if ($sign != stripslashes($_GET["client_secret"])) {
log::instance()->error("ret: 签名无效");
echo "ERROR_SIGN";
exit;
}
if (stripslashes($_GET["result"]) == 2) {
log::instance()->error("ret: 支付失败");
echo "SUCCESS";
exit;
}
$note = json_decode(stripslashes($_GET["aid"]), true);
$ret = recharge($pf_info["PF"], $note["sid"], stripslashes($_GET["orderid"]), $note["uid"], $note["item"], stripslashes($_GET["amount"]), stripslashes($_GET["orderid"]), 0);
log::instance()->debug("ret: " . $ret);
if ($ret == "TRADE_NO NOT EXIST") {
$ret = "ERROR_REPEAT";
} else {
if ($ret != "SUCCESS") {
$ret = "ERROR_FAIL";
}
}
echo $ret;
示例7: error_reporting
<?php
error_reporting(E_ALL);
require_once "class.authentification.php";
require_once 'class.config.php';
require_once "class.demandeListe.php";
require_once "class.demande.php";
require_once "class.log.php";
require_once "class.validation.php";
require_once "class.userData.php";
require_once "class.car.php";
define('CANCEL_DEMAND_POST', 'cancelDemand');
define('REACTIVATE_DEMAND_POST', 'reactivateDemand');
$objAuth = authentification::instance();
$objLog = log::instance();
$objvalid = validation::instance();
$objDemandeListe = new demandeListe();
$objDemande = null;
$fileFieldIndex = 0;
if ($objAuth->estIdentifie()) {
$matricule = $_SESSION['usager'];
$submissionTarget = util::getParam($_POST, 'submissionTarget');
$submissionType = util::getParam($_POST, 'submissionType');
$demande = new demande($matricule);
if ($submissionTarget == 'demande') {
if ($submissionType == CANCEL_DEMAND_POST) {
$demande->cancelDemand();
header("Location: demande.php");
} else {
if ($submissionType == REACTIVATE_DEMAND_POST) {
$demande->reactivateDemand();
示例8: array
$pay_cookie = array('session_id' => 'openid', 'session_type' => 'kp_actoken', 'org_loc' => '/mpay/pay_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()->debug("ret: 扣款成功 " . urldecode(json_encode($result)));
$response['balance'] = $result['balance'];
} else {
log::instance()->error("ret: 扣款失败 " . urldecode(json_encode($result)));
$response['err_code'] = $result['err_code'];
echo json_encode($response);
exit;
}
// 发钻石
$note = json_decode(stripslashes($params['appmeta']), true);
$ret = recharge($pf_info["PF"], stripslashes($params["zoneid"]), $note["odr"], $note["uid"], $note["item"], $params["save_num"] / 10, $result["billno"], 0);
log::instance()->debug("ret: " . $ret);
if ($ret != "SUCCESS" && $ret != "TRADE_NO NOT EXIST") {
// 退款
$pay_params = array('openid' => $params['openid'], 'openkey' => $params['openkey'], 'pay_token' => $params['pay_token'], 'ts' => time(), 'pf' => $params['pf'], 'zoneid' => $params['zoneid'], 'amt' => $params['save_num'], 'pfkey' => $params['pfkey'], 'billno' => $result['billno']);
$pay_cookie = array('session_id' => 'openid', 'session_type' => 'kp_actoken', 'org_loc' => '/mpay/cancel_pay_m');
$result = $openApi->api($pay_cookie['org_loc'], $pay_params, $pay_cookie, 'GET', 'https');
$result['msg'] = urlencode($result['msg']);
$response = array('type' => 2, 'ret' => $result['ret']);
if ($result['ret'] === 0) {
log::instance()->debug("ret: 退款成功 " . urldecode(json_encode($result)));
} else {
log::instance()->error("ret: 退款失败 " . urldecode(json_encode($result)));
}
}
echo json_encode($response);
示例9: init
/**
* Short description of method instance
*
* @access private
* @return void
*/
private function init()
{
$this->objLog = log::instance();
}
示例10: send_password_email
public function send_password_email($password)
{
try {
$mail = mail::create('userautocreated')->to($this->email)->tokenise(array('username' => $this->username, 'password' => $password))->send();
return true;
} catch (exception $e) {
log::instance('Couldnt send user autogenerated password', $e);
}
return false;
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->objDatabase = database::instance();
$this->objLog = log::instance();
}
示例12: init
public function init()
{
$this->objLog = log::instance();
$this->database = database::instance();
$this->car1 = new car(1);
$this->car2 = new car(2);
$this->userData = new userData($this->matricule);
$this->userData->getUserData($_SESSION['usager']);
}
示例13: init
/**
* Short description of method instance
*
* @access private
* @return void
*/
private function init()
{
$this->objDatabase = database::instance();
$this->objLog = log::instance();
session_save_path(config::PhpSessionPath);
session_set_cookie_params(0);
session_start();
$this->estIdentifie();
}