本文整理汇总了PHP中logger::info方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::info方法的具体用法?PHP logger::info怎么用?PHP logger::info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger
的用法示例。
在下文中一共展示了logger::info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJsApiTicket
/**
* 获得jsapi_ticket 应该全局存储与更新
* @return string
*/
private function getJsApiTicket($bind_id)
{
if (base_kvstore::instance('weixin')->fetch('basic_jsapi_ticket_' . $bind_id, $jsapi_ticket) !== false) {
logger::info('kv获取jsapi_ticket' . $jsapi_ticket);
return $jsapi_ticket;
} else {
$accessToken = kernel::single('weixin_wechat')->get_basic_accesstoken($bind_id);
// 如果是企业号用以下 URL 获取 ticket
// $url = "https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=$accessToken";
$url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token={$accessToken}";
$httpclient = kernel::single('base_httpclient');
$response = $httpclient->set_timeout(6)->get($url);
$result = json_decode($response, true);
$jsapi_ticket = $result['ticket'];
if ($jsapi_ticket) {
if (!base_kvstore::instance('weixin')->store('basic_jsapi_ticket_' . $bind_id, $jsapi_ticket, $result['expires_in'])) {
// 微信jsapi_ticket的有效期,单位为秒
logger::info("KVSTORE写入公众账号绑定id为: {$bind_id} 的jsapi_ticket错误");
}
logger::info('远程获取jsapi_ticket' . $jsapi_ticket);
return $jsapi_ticket;
} else {
//todo : 错误提示
}
}
}
示例2: generate
/**
* 发货之后通知到微信
*/
public function generate($data)
{
$order_id = $data['order_id'];
$ordersData = app::get('b2c')->model('orders')->getRow('ship_status', array('order_id' => $order_id));
if ($ordersData['ship_status'] != '1') {
$msg = app::get('weixin')->_('未发货不需要同步到微信');
logger::info($msg);
return true;
}
$payments = app::get('ectools')->model('payments')->get_payments_by_order_id($order_id);
if (empty($payments)) {
$msg = app::get('weixin')->_('未找到支付信息');
logger::info($msg);
return true;
}
if ($payments[0]['pay_app_id'] != 'wxpay') {
//$msg = app::get('weixin')->_('不是微信支付不需要通知到微信');
return true;
}
$postData['openid'] = $payments[0]['thirdparty_account'];
$postData['transid'] = $payments[0]['trade_no'];
$postData['out_trade_no'] = $payments[0]['payment_id'];
$postData['deliver_timestamp'] = strval(time());
$postData['deliver_status'] = '1';
$postData['deliver_msg'] = 'ok';
kernel::single('weixin_wechat')->delivernotify($postData);
return true;
}
示例3: post_update
public function post_update($dbver)
{
if ($dbver['dbver'] <= 0.4) {
app::get('ectools')->setConf('ectools_payment_plugin_doubletenpay', 'a:3:{s:7:"setting";a:7:{s:8:"pay_name";s:18:"财付通双接口";s:7:"pay_fee";s:0:"";s:6:"mer_id";s:0:"";s:10:"PrivateKey";s:0:"";s:11:"support_cur";s:1:"1";s:8:"authtype";s:0:"";s:8:"pay_desc";s:6:" ";}s:6:"status";s:5:"false";s:8:"pay_type";s:4:"true";}');
logger::info('UPDATEING 财付通双接口支付方式更新成功');
}
}
示例4: command_sync_user
public function command_sync_user()
{
//kernel::console_output = false;
$http = kernel::single('base_httpclient');
$response = $http->get(app::get('suitclient')->getConf('syncuser'));
if ($response) {
$server_users = json_decode($response);
$model = app::get('pam')->model('account');
$result = $model->getList('login_name', array('account_type' => 'shopadmin'));
$client_user = array();
foreach ($result as $value) {
$client_user[] = $value['login_name'];
}
$model2 = app::get('desktop')->model('users');
foreach ($server_users as $server_user) {
if (!in_array($server_user, $client_user)) {
$user = array('name' => $server_user, 'status' => 1, 'super' => 0, 'disabled' => false, 'pam_account' => array('login_name' => $server_user, 'login_password' => md5(time() . rand()), 'account_type' => 'shopadmin'), 'roles' => array(array('role_id' => 1)));
$model2->save($user);
}
}
logger::info('同步成功');
logger::info('ok.');
//不加 "ok."则会弹提示信息并不能自动关闭@lujy
} else {
logger::info('同步失败或套件里没有用户');
logger::info('ok.');
}
exit;
}
示例5: post_uninstall
public function post_uninstall()
{
$init = kernel::single('cps_init');
logger::info('Uninstall cps');
$inst = kernel::single('cps_theme_inst');
$inst->uninstTheme();
}
示例6: post_install
function post_install($options)
{
pam_account::register_account_type('b2c', 'member', '前台会员系统');
logger::info('Init Initial');
vmc::singleton('base_initial', 'b2c')->init();
logger::info('Init member attribute');
app::get('b2c')->model('member_attr')->init();
logger::info('Init seo meta');
//SEO 字段初始化
$obj_goods = app::get('b2c')->model('goods');
$obj_brand = app::get('b2c')->model('brand');
$obj_goodscat = app::get('b2c')->model('goods_cat');
$col = array('seo_info' => array('type' => 'serialize', 'label' => app::get('b2c')->_('seo设置')));
$obj_goods->meta_register($col);
$obj_brand->meta_register($col);
$obj_goodscat->meta_register($col);
//Application
$rows = app::get('base')->model('apps')->getList('app_id', array('installed' => 1));
foreach ($rows as $r) {
if ($r['app_id'] == 'base') {
continue;
}
$this->xml_update($r['app_id']);
}
}
示例7: post_install
function post_install()
{
logger::info('Initial themes');
kernel::single('site_theme_base')->set_last_modify();
kernel::single('site_theme_install')->initthemes();
$themes = kernel::single('site_theme_install')->check_install();
}
示例8: call
public function call($method, $params, $appId)
{
$prismHost = config::get('prism.prismHostUrl');
$prismSocketFile = config::get('prism.prismSocketFile');
//获取应用对应的key和secret
$keySecret = apiUtil::getPrismKey($appId);
$key = $keySecret['key'];
$secret = $keySecret['secret'];
//获取path
$path = apiUtil::genApiPath($method);
//params加入系统数据
$systemParams = $this->__genSystemParams($method);
$params = array_merge($params, $systemParams);
$params['method'] = $method;
//实例化请求工具
$client = new base_prism_client($prismHost, $key, $secret, $prismSocketFile);
//$path = "/api/bbc?method=bbc.test";
$result = $client->post($path, $params);
//日志记录
//之前request和response分开记录的,发现不容易找,只好放一起了
logger::info('call API : ' . $method . "\n" . 'wiht host : ' . $prismHost . "\n" . 'wiht key : ' . $key . "\n" . 'wiht secret : ' . $secret . "\n" . 'with params :' . var_export($params, 1) . "\n" . 'api result : ' . $result . "\n");
//这里是返回数据
$result = json_decode($result, 1);
if ($result['error'] == null) {
return $result['result'];
} else {
//根据返回的数据是否错误,如果有错误,尽量以原有异常抛出
$exception = $result['error']['exception'] ? $result['error']['exception'] : 'Exception';
logger::error(var_export($result, 1));
$e = new $exception($result['error']['message']);
throw $e;
}
}
示例9: cancel
public function cancel($secondTime)
{
$minuteTime = $secondTime / 60;
$secondTime = time() - $secondTime;
$params['data']['cancel_reason'] = "订单未在下单" . $minuteTime . "分钟内完成支付,被系统自动关闭。";
$params['data']['status'] = "TRADE_CLOSED_BY_SYSTEM";
$params['data']['end_time'] = time();
//$params['filter']['created_time|sthan'] = $secondTime;
//$params['filter']['status'] ='WAIT_BUYER_PAY';
$paramsForList['rows'] = 'tid';
$paramsForList['filter'] = ['created_time|sthan' => $secondTime, 'status' => 'WAIT_BUYER_PAY'];
$tidList = kernel::single('systrade_data_trade')->getTradeList($paramsForList, false);
foreach ($tidList as $tid) {
try {
$params['filter']['tid'] = $tid['tid'];
$objTradeCancel = kernel::single('systrade_data_trade_cancel');
$result = $objTradeCancel->generate($params);
} catch (\LogicException $e) {
$msg = $e->getMessage();
logger::info('Cancel the order(' . $tid['tid'] . ') LogicException log automatically:' . $msg);
} catch (Exception $e) {
$msg = $e->getMessage();
logger::info('Cancel the order(' . $tid['tid'] . ') error log automatically:' . $msg);
}
}
return true;
}
示例10: command_clear
function command_clear()
{
if (!$this->files->isWritable(kernel::getCachedRoutesPath())) {
logger::info(sprintf('Sorry, route cahce path:%s cannot delete!', kernel::getCachedRoutesPath()));
}
$this->files->delete(kernel::getCachedRoutesPath());
logger::info('Route cache Cleared!');
}
示例11: active
static function active($app_id = 'b2c')
{
if (self::get('node_id', $app_id)) {
logger::info('Using exists shopnode: kvstore shop_site_node_id');
} else {
logger::info('Request new shopnode');
self::register($app_id);
}
}
示例12: __loginLog
private function __loginLog($msg)
{
$log['IP'] = request::getClientIp();
$log['uname'] = input::get('uname');
$log['msg'] = $msg;
$log['HTTP_REFERER'] = $_SERVER['HTTP_REFERER'];
$log['type'] = 'shopadmin';
logger::info('ADMIN_LOGIN:' . var_export($log, 1));
}
示例13: removeQueue
public function removeQueue($appId, $queueName)
{
logger::info('Remove prism queue: "' . $queueName . '" from "' . $appId . '".');
$queueInfo = kernel::single('system_prism_init_queue')->queueStaus($appId, $queueName);
if ($queueInfo['Backing_queue_status']['Len'] > 0) {
logger::info('Some data is in queue, queue "' . $queueName . '" won\'t be removed.');
return false;
}
return kernel::single('system_prism_init_queue')->queueDrop($appId, $queueName);
}
示例14: send
public function send($target, $title, $content, $config)
{
logger::info(__CLASS__ . var_export(func_get_args(), 1));
if (!($member_id = $target['member_id'])) {
return false;
}
$uname = vmc::singleton('b2c_user_object')->get_member_name(null, $member_id);
$new_msg = array('member_id' => $member_id, 'target' => $uname, 'subject' => $title, 'content' => $content, 'createtime' => time(), 'status' => 'sent');
return app::get('b2c')->model('member_msg')->save($new_msg);
}
示例15: exec
public function exec($params = null)
{
$filter = array('status' => array('4', '5'), 'add_time|lthan' => strtotime('-3 month'));
$offset = 0;
while ($listFlag = $this->get_return_ids($limit_return_ids, $filter, $offset)) {
$offset++;
$this->archive($limit_return_ids);
}
logger::info("归档创建时间小于 " . date('Y-m-d H:i:s', $filter['add_time|lthan']) . " 的售后单");
}