本文整理匯總了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
}