本文整理汇总了PHP中logger::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::warning方法的具体用法?PHP logger::warning怎么用?PHP logger::warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger
的用法示例。
在下文中一共展示了logger::warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
public function connect($ip, $port)
{
$this->remoteip = $ip;
$this->remoteport = $port;
$errno = 0;
$errstr = '';
logger::debug("Connecting to %s:%d", $ip, $port);
$this->state = SOCKSTATE_CONNECTING;
$this->fsh = fsockopen($ip, $port, $errno, $errstr);
if ($errno) {
logger::warning("Socket error: %d %s (%s:%d)", $errno, $errstr, $ip, $port);
$this->state = SOCKSTATE_ERROR;
return false;
} else {
if (!$this->fsh) {
$this->state = SOCKSTATE_ERROR;
logger::warning("No socket handle returned but no error indicated");
return false;
}
logger::debug("Socket connected to %s:%d", $ip, $port);
stream_set_timeout($this->fsh, 0, 200);
$this->state = SOCKSTATE_CONNECTED;
return true;
}
}
示例2: getupdatesql
public static function getupdatesql($table_name, &$data, $whereClause)
{
$db = vmc::database();
if (!$table_name) {
trigger_error('getupdatesql UNKNOW TABLE_NAME', E_USER_WARNING);
return false;
}
foreach ($data as $key => $value) {
$data[strtolower($key)] = $value;
}
$table_fields = $db->fetch_colum('DESCRIBE ' . $table_name, 0);
$table_fields_type = $db->fetch_colum('DESCRIBE ' . $table_name, 1);
$table_fields = array_combine($table_fields, $table_fields_type);
$ready_update_str_arr = array();
foreach ($table_fields as $key => $type) {
if (isset($data[$key])) {
$ready_update_str_arr[] = '`' . $key . '`=' . self::quotevalue($db, $data[$key], $type);
}
}
if (count($ready_update_str_arr) > 0) {
$update_str = implode(',', $ready_update_str_arr);
$sql = 'UPDATE ' . $table_name . ' SET ' . $update_str;
if (strlen($whereClause) > 0) {
$sql .= ' WHERE ' . $whereClause;
} else {
logger::warning('全表更新被拦截' . $sql);
return '';
}
return $sql;
} else {
return '';
}
}
示例3: addAnimator
public function addAnimator($property, ILpfAnimator $animator, $frstart, $frend)
{
if (arr::hasKey($this->_properties, $property)) {
$this->_animators[$property][] = array('animator' => $animator, 'framestart' => $frstart, 'frameend' => $frend);
console::writeLn("Attached animator: %s => %s", typeOf($animator), $property);
} else {
logger::warning("Animator attached to nonexisting property %s of object %s", $property, (string) $this->_object);
}
}
示例4: __get
public function __get($property)
{
if (arr::hasKey($this->properties, $property)) {
$propmeta = $this->properties[$property];
if ($propmeta['propget']) {
return $propmeta['propget']($property);
} else {
return $this->properties['value'];
}
} else {
logger::warning("Ambient property %s requested object %s", $property, $this);
}
}
示例5: exec
public function exec($params = null)
{
$order_autocancel_day = app::get('b2c')->getConf('order_autofinish_day', 9);
//天
$mdl_orders = app::get('b2c')->model('orders');
$limit = 200;
//每次最多处理200条
$filter = array('status' => 'active', 'pay_status' => '1', 'ship_status' => '1', 'createtime|lthan' => time() - $order_autocancel_day * 24 * 3600);
foreach ($mdl_orders->getList('order_id', $filter, 0, $limit) as $key => $order) {
$order['op_id'] = '-1';
$order['op_name'] = '定时任务队列';
if (!vmc::singleton('b2c_order_end')->generate($order, $msg)) {
logger::warning('订单自动完成队列异常。ORDER_ID:' . $order['order_id'] . '。' . $msg);
}
}
return false;
}
示例6: query
public function query($query = null, $debug = false)
{
if ($this->_dbo == null) {
logger::error("dbo::query: A connection needs to be made with the db server first!");
exit("Error: A connection needs to be made with the db server first!");
}
if ($query === null && $this->_query != "") {
$query = $this->_query;
} elseif ($query === null) {
if ($this->_debug || $debug) {
logger::warning("dbo::query: No SQL query was provided to execute.");
}
return false;
}
$this->_query = $query;
$query = str_replace("##_", $this->_prefix, $query);
logger::debug("dbo::query: query: {$query}");
$this->_record_set = $this->_dbo->query($query);
if ($this->_dbo->errno != 0) {
logger::error("dbo::query: An error occured executing the query.");
logger::error("The error is: '" . $this->_dbo->error . "'");
exit("Error: The query failed. {$query}");
}
$this->result_count = $this->_dbo->affected_rows;
if ($this->_dbo->errno != 0) {
logger::error("dbo::query: An error occured calculating the number of results.");
logger::error("The error is: '" . $this->_dbo->error . "'");
exit("Error: Couldn't count the number of records.");
}
$this->fields = array();
if (strtoupper(substr($query, 0, 6)) == "SELECT") {
$temp = $this->_record_set->fetch_fields();
foreach ($temp as $t) {
$this->fields[] = $t->name;
}
if ($this->_dbo->errno != 0) {
logger::error("dbo::query: An error occured fetching the fields of the result.");
logger::error("The error is: '" . $this->_dbo->error . "'");
exit("Error: Couldn't fetch the fields.");
}
}
return $this->_record_set;
}
示例7: exec
/**
* 用于订单退货确认,并影响售后服务单.
*
* @params array - 退货单据数据SDF
*
* @return bool - 执行成功与否
*/
public function exec($delivery_sdf, &$msg = '')
{
$mdl_as_request = $this->app->model('request');
$req_order = $mdl_as_request->getRow('*', array('delivery_id' => $delivery_sdf['delivery_id']));
if (!$req_order) {
return true;
}
if ($req_order['status'] != '3' || $delivery_sdf['status'] != 'succ') {
$msg = '不在退货处理流程中或错误的退货确认指令!';
return false;
}
$req_order['status'] = '4';
//退货成功,进入退款流程
if ($mdl_as_request->save($req_order)) {
return true;
} else {
$msg = '存在售后服务单据,售后服务单据状态更新异常!';
logger::warning($msg . 'request_id:' . $req_order['request_id']);
return false;
}
}
示例8: filter
public function filter(&$filter, &$cart_result, $config = array())
{
// 取出符合当前购物车条件的规则(已经使用了conditions过滤)
$this->_filter_rules($cart_result, $config);
$this->used_rules = array('normal' => array(), 'coupon' => array());
$rules_groups = array('normal' => $this->ready_normal_rules, 'coupon' => $this->ready_coupon_rules);
foreach ($rules_groups as $key => $ready_type_items) {
foreach ($ready_type_items as $rule) {
if ($this->used_rules[$key][$rule['rule_id']]) {
continue;
}
/**
* $cart_result 是引用传递,会在内部进行修改
*/
if (!$this->_apply_order($cart_result, $rule, $save)) {
continue;
}
$solution = $rule['action_solution'];
if (!$solution) {
continue;
}
reset($solution);
$solution_class = key($solution);
if (!$solution_class) {
logger::warning('优惠方案异常!' . var_export($rule, 1));
continue;
}
$this->_add_promotion_to_cart($solution_class, $rule, $cart_result, $key);
$this->used_rules[$key][$rule['rule_id']] = true;
}
}
foreach ($cart_result['objects']['coupon'] as &$coupon) {
/**
* @see line 200~210
*/
if ($coupon['params']['in_use'] != 'true') {
$coupon['params']['warning'] = '优惠券未被成功使用!';
}
}
}
示例9: _error
/**
*_error 记录错误和警告log
*
* @param string $query_sql 执行的sphinxql语句
* @access public
*/
public function _error($query_sql)
{
$br = "\r\n\t\t\t\t";
$msg = 'sphinxql执行错误:' . $query_sql;
if (mysql_error()) {
$error = mysql_error();
$msg .= $br . 'ERROR :' . $error;
throw new Exception($msg);
}
$warnings = $this->query('SHOW WARNINGS');
if ($warnings) {
foreach ($warnings as $row) {
$msg .= $br . 'WARNING (' . $row['Code'] . '):' . $row['Message'];
}
logger::warning($msg);
}
}
示例10: delete
/**
* delete.
*
* 根据条件删除条目
* 不可以由pipe控制
* 可以广播事件
*
* @param mixed $filter
* @param mixed $named_action
*/
public function delete($filter)
{
$where_sql = $this->filter($filter);
$sql = 'DELETE FROM `' . $this->table_name(1) . '` where ' . $where_sql;
if (!stripos($where_sql, 'AND')) {
logger::warning('全表删除操作被拦截!SQL:' . $sql);
return false;
}
if ($this->db->exec($sql, $this->skipModifiedMark)) {
return true;
} else {
return false;
}
}
示例11: foreach
/*
Wait for a valid event occurs that we can process, OR
up to the timeout limit, in which case we then go and
check if there's anything in the message queue that
needs processing
*/
$payloads = $conn->processUntil(array('message', 'presence', 'end_stream', 'session_start'), MESSAGE_TIMEOUT_SECONDS);
foreach ($payloads as $event) {
$pl = $event[1];
switch ($event[0]) {
case 'message':
// check sender - we only allow messages from the configured recipient
if (preg_match("/^{$config[$section]["xmpp_reciever"]}\\/\\w\$/", $pl["from"])) {
// denied
$conn->message($pl["from"], $body = "Sorry you are not a user whom is permitted to talk with me. :-(");
$log->warning("[{$section}] Denied connection attempt from {$pl["from"]}, only connections from {$config[$section]["xmpp_reciever"]} are permitted");
break;
}
// trim whitespace from message
$pl["body"] = trim($pl["body"]);
// process message
switch ($pl["body"]) {
case "_help":
case "_about":
case "_license":
case "_version":
/*
User help & application status
*/
$help = array();
$help[] = "" . APP_NAME . " (" . APP_VERSION . ")";
示例12: registerFactory
public static function registerFactory(LoggerFactory $factory)
{
foreach (self::$_loggers as $logger) {
if (typeOf($logger) == typeOf($factory)) {
logger::warning('Attempting to register logger %s twice', typeOf($factory));
return;
}
}
self::$_loggers[] = $factory;
}
示例13: error_handle
public function error_handle($code, $msg, $file, $line)
{
if ($code == ($code & (E_ERROR ^ E_USER_ERROR ^ E_USER_WARNING))) {
if ($code == ($code & (E_ERROR ^ E_USER_ERROR))) {
logger::error(sprintf('ERROR:%d @ %s @ file:%s @ line:%d', $code, $msg, $file, $line));
exit;
}
logger::warning(sprintf('WARNING:%d @ %s @ file:%s @ line:%d', $code, $msg, $file, $line));
}
return true;
}
示例14: couponlog
/**
* 优惠券使用日志记录.
*/
public function couponlog($params, &$msg)
{
if (!$params || !is_array($params) || empty($params['member_id']) || empty($params['order_id']) || empty($params['order_total']) || empty($params['coupon_save']) || empty($params['memc_code']) || empty($params['cpns_name']) || empty($params['cpns_id'])) {
$msg = '优惠券日志记录缺少参数!';
logger::warning($msg . $member_id . '|' . $memc_code . '|' . $order_id);
return false;
}
$new_member_couponlog = array_merge($params, array('usetime' => time()));
logger::debug('优惠券日志记录成功' . var_export($new_member_couponlog, 1));
$this->app->model('member_couponlog')->save($new_member_couponlog);
return true;
}
示例15: dopayment
/**
* 准备跳转到支付平台.
*
* @param mixed $order_id 订单编号
* @param $recursive 递归调用标记
*/
public function dopayment($order_id, $recursive = false)
{
$redirect = $this->gen_url(array('app' => 'b2c', 'ctl' => 'mobile_member', 'act' => 'orders'));
$obj_bill = vmc::singleton('ectools_bill');
$mdl_bills = app::get('ectools')->model('bills');
$order = $this->app->model('orders')->dump($order_id);
if ($order['pay_status'] == '1' || $order['pay_status'] == '2') {
$this->splash('success', $redirect, '已支付');
}
if (in_array($order['pay_app'], array('cod', 'offline'))) {
$this->splash('error', $redirect, '不是在线支付方式');
}
if ($this->app->member_id != $order['member_id']) {
$this->splash('error', $redirect, '非法操作');
}
//未交互过的账单复用
$bill_sdf = array('order_id' => $order['order_id'], 'bill_type' => 'payment', 'pay_mode' => 'online', 'pay_object' => 'order', 'money' => $order['order_total'] - $order['payed'], 'member_id' => $order['member_id'], 'status' => 'ready', 'pay_app_id' => $order['pay_app'], 'pay_fee' => $order['cost_payment'], 'memo' => $order['memo']);
$exist_bill = $mdl_bills->getRow('*', $bill_sdf);
//一天内重复利用原支付单据
if ($exist_bill && !empty($exist_bill['bill_id']) && $exist_bill['createtime'] + 86400 > time()) {
$bill_sdf = array_merge($exist_bill, $bill_sdf);
} else {
$bill_sdf['bill_id'] = $mdl_bills->apply_id($bill_sdf);
}
$bill_sdf['return_url'] = $this->gen_url(array('app' => 'b2c', 'ctl' => 'mobile_checkout', 'act' => 'payresult', 'args' => array($bill_sdf['bill_id'])));
//微信内支付时,需要静默授权,以获得用户openid
if (base_mobiledetect::is_wechat() && $order['pay_app'] == 'wxpay' && empty($bill_sdf['payer_account'])) {
$wxpay_setting = unserialize(app::get('ectools')->getConf('wechat_payment_applications_wxpay'));
$wxpay_appid = $wxpay_setting['appid'];
$wxpay_appsecret = $wxpay_setting['appsecret'];
$auth_code = $_GET['code'];
$auth_state = $_GET['state'];
if (!$recursive) {
$oauth_redirect = $this->gen_url(array('app' => 'b2c', 'ctl' => 'mobile_checkout', 'act' => 'dopayment', 'args' => array($order_id, 'recursive'), 'full' => 1));
$oauth_redirect = urlencode($oauth_redirect);
$oauth_action = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$wxpay_appid}&redirect_uri={$oauth_redirect}&response_type=code&scope=snsapi_base&state={$order_id}#wechat_redirect";
logger::debug('微信snsapi_base URL:' . $oauth_action);
$this->redirect($oauth_action);
//静默授权
} elseif ($recursive && $auth_code && $auth_state == $order_id) {
//把微信用户openid 记录到支付单据中
$auth_token = vmc::singleton('base_httpclient')->get("https://api.weixin.qq.com/sns/oauth2/access_token?appid={$wxpay_appid}&secret={$wxpay_appsecret}&code={$auth_code}&grant_type=authorization_code");
$auth_token = json_decode($auth_token, 1);
if (!$auth_token['openid']) {
logger::warning('微信静默授权失败!' . var_export($auth_token, 1));
$this->splash('error', $redirect, '暂无法进行微信内支付。');
}
$bill_sdf['payer_account'] = $auth_token['openid'];
} else {
logger::warning('微信静默授权失败!order_id:' . $order_id . '|' . var_export($_GET, 1));
}
}
try {
if (!$obj_bill->generate($bill_sdf, $msg)) {
$this->splash('error', $redirect, $msg);
}
} catch (Exception $e) {
$this->splash('error', $redirect, $e->getMessage());
}
$get_way_params = $bill_sdf;
if (!vmc::singleton('ectools_payment_api')->redirect_getway($get_way_params, $msg)) {
$this->splash('error', $redirect, $msg);
}
//here we go to the platform
}