本文整理汇总了PHP中logger_print函数的典型用法代码示例。如果您正苦于以下问题:PHP logger_print函数的具体用法?PHP logger_print怎么用?PHP logger_print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logger_print函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pvat_hook_interceptincomingsms
function pvat_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
$msg = explode(" ", $message);
$ret = array();
if (count($msg) > 1) {
$pv = trim($msg[0]);
if (substr($pv, 0, 1) == '@') {
$c_username = substr($pv, 1);
$new_message = "PV " . $c_username . " ";
if (username2uid($c_username)) {
for ($i = 1; $i < count($msg); $i++) {
$new_message .= $msg[$i] . " ";
}
$new_message = substr($new_message, 0, -1);
// set 1 to param_modified to let parent function modify param values
$ret['modified'] = true;
// this time only message param changed
$ret['param']['message'] = $new_message;
$sms_datetime = core_display_datetime($sms_datetime);
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " m:" . $message . " mod:" . $ret['param']['message'], 3, "pvat");
// do not forget to tell parent that this SMS has been hooked
$ret['hooked'] = true;
}
}
}
return $ret;
}
示例2: xlate_hook_recvsms_intercept
function xlate_hook_recvsms_intercept($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
$msg = explode(" ", $message);
$ret = array();
if (count($msg) > 1) {
$keyword = trim($msg[0]);
if (substr($keyword, 0, 1) == '@') {
$xlate = substr($keyword, 1);
$xlate = explode('2', $xlate);
$xlate_from = $xlate[0];
$xlate_to = $xlate[1];
if ($xlate_from && $xlate_to && strlen($xlate_from) == 2 && strlen($xlate_to) == 2) {
for ($i = 1; $i < count($msg); $i++) {
$words .= $msg[$i] . " ";
}
$words = trim($words);
// contact google
$lib = $core_config['apps_path']['plug'] . '/feature/xlate/lib/GoogleTranslate';
// load JSON.php for PHP version lower than 5.2.x
require_once $lib . '/JSON.php';
require_once $lib . '/googleTranslate.class.php';
if ($gt = new GoogleTranslateWrapper()) {
/* Translate */
$xlate_words = $gt->translate($words, $xlate_to, $xlate_from);
// incoming sms is handled
$ret['hooked'] = true;
/* Was translation successful */
$sms_datetime = core_display_datetime($sms_datetime);
if ($gt->isSuccess()) {
$reply = '@' . $xlate_from . '2' . $xlate_to . ' ' . $words . ' => ' . $xlate_words;
logger_print("success dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " w:" . $words . " from:" . $xlate_from . " to:" . $xlate_to . " xlate:" . $xlate_words, 2, "xlate");
} else {
$reply = '@' . $xlate_from . '2' . $xlate_to . ' ' . _("unable to translate") . ': ' . $words;
logger_print("failed dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " w:" . $words . " from:" . $xlate_from . " to:" . $xlate_to, 2, "xlate");
}
// detect reply message, set unicode if not ASCII
$unicode = core_detect_unicode($reply);
// send reply SMS using admin account
// should add a web menu in xlate.php to choose which account will be used to send reply SMS
// usualy we inspect the result of sendsms, but not this time
logger_print("send reply encoding:" . $encoding, 2, "xlate");
$reply = addslashes($reply);
list($ok, $to, $smslog_id, $queue) = sendsms_helper('admin', $sms_sender, $reply, 'text', $unicode);
// do not forget to tell parent that this SMS has been hooked
$ret['hooked'] = true;
} else {
// unable to load the class, set incoming sms unhandled
$ret['hooked'] = false;
logger_print("class not exists or fail to load", 2, "xlate");
}
}
}
}
return $ret;
}
示例3: simplebilling_hook_billing_finalize
function simplebilling_hook_billing_finalize($smslog_id)
{
$ok = false;
logger_print("saving smslog_id:" . $smslog_id, 2, "simplebilling finalize");
$db_query = "UPDATE " . _DB_PREF_ . "_tblBilling SET status='1' WHERE smslog_id='{$smslog_id}'";
if ($db_result = dba_affected_rows($db_query)) {
logger_print("saved smslog_id:" . $smslog_id, 2, "simplebilling finalize");
$ok = true;
}
return $ok;
}
示例4: dba_query
function dba_query($mystring, $from = "0", $count = "0")
{
global $dba_object, $dba_DB, $DBA_ROW_COUNTER, $DBA_LIMIT_FROM, $DBA_LIMIT_COUNT;
// log all db query
if (function_exists('logger_print')) {
logger_print("q:" . $mystring, 4, "dba query");
}
$DBA_ROW_COUNTER = 0;
if ($DBA_LIMIT_COUNT > 0) {
$from = $DBA_LIMIT_FROM;
$count = $DBA_LIMIT_COUNT;
}
$DBA_LIMIT_FROM = 0;
$DBA_LIMIT_COUNT = 0;
if ($from == 0 && $count == 0) {
$result = dba_query_simple($mystring);
return $result;
}
$is_special = false;
switch ($dba_DB) {
case "mssql":
$limit = $from + $count;
if ($limit == $count) {
$str_limit = "SELECT TOP {$limit}";
$mystring = str_replace("SELECT", $str_limit, $mystring);
$is_special = true;
}
break;
case "mysql":
case "mysqli":
$str_limit = " LIMIT {$from}, {$count}";
$mystring .= $str_limit;
$is_special = true;
break;
default:
break;
}
if ($is_special) {
$result = $dba_object->query($mystring);
} else {
$result = $dba_object->limitQuery($mystring, $from, $count);
}
if (DB::isError($dba_object)) {
// ob_end_clean();
// die ("<p align=left>".$dba_object->getMessage()."<br>".$dba_object->userinfo."<br>");
return "";
}
if (!$is_special) {
$result->limit_from = $from;
$result->limit_count = $count;
}
return $result;
}
示例5: myauto_hook_interceptincomingsms
function myauto_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
// reply message
$reply = 'Thank you for your message';
// detect reply message, set unicode if not ASCII
$unicode = core_detect_unicode($reply);
// send reply
list($ok, $to, $smslog_id, $queue) = sendsms('admin', $sms_sender, $reply, 'text', $unicode);
// log it
$sms_datetime = core_display_datetime($sms_datetime);
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " autorespon:" . $reply, 2, "myauto");
}
示例6: sendmail
function sendmail($mail_from, $mail_to, $mail_subject = "", $mail_body = "")
{
global $core_config;
$ok = false;
for ($c = 0; $c < count($core_config['toolslist']); $c++) {
if (x_hook($core_config['toolslist'][$c], 'sendmail', array($mail_from, $mail_to, $mail_subject, $mail_body))) {
logger_print("sent from:" . $mail_from . " to:" . $mail_to . " subject:" . $mail_subject, 3, "sendmail");
$ok = true;
break;
}
}
return $ok;
}
示例7: msgtemplate_hook_interceptsendsms
function msgtemplate_hook_interceptsendsms($sms_sender, $sms_footer, $sms_to, $sms_msg, $uid, $gpid, $sms_type, $unicode)
{
// parameters modified
$ret['modified'] = true;
// the modification to $sms_msg
$text = $sms_msg;
$text = str_replace('#NAME#', phonebook_number2name($sms_to), $text);
$text = str_replace('#NUM#', $sms_to, $text);
$ret['param']['sms_msg'] = $text;
// log it
logger_print("to:" . $sms_to . " msg:" . $sms_msg . " replacedby:" . $ret['param']['sms_msg'], 3, "msgtemplate");
return $ret;
}
示例8: simplebilling_hook_billing_getdata
function simplebilling_hook_billing_getdata($smslog_id)
{
$ret = array();
logger_print("smslog_id:" . $smslog_id, 3, "simplebilling getdata");
$db_query = "SELECT id,rate,credit,status FROM " . _DB_PREF_ . "_tblBilling WHERE smslog_id='{$smslog_id}'";
$db_result = dba_query($db_query);
if ($db_row = dba_fetch_array($db_result)) {
$id = $db_row['id'];
$post_datetime = $db_row['post_datetime'];
$rate = $db_row['rate'];
$credit = $db_row['credit'];
$status = $db_row['status'];
$ret = array('id' => $id, 'smslog_id' => $smslog_id, 'post_datetime' => $post_datetime, 'status' => $status, 'rate' => $rate, 'credit' => $credit);
}
return $ret;
}
示例9: dlrd
function dlrd()
{
global $core_config;
$core_config['dlrd_limit'] = (int) $core_config['dlrd_limit'] ? (int) $core_config['dlrd_limit'] : 200;
$list = dba_search(_DB_PREF_ . '_tblDLR', '*', array('flag_processed' => 1), '', array('LIMIT' => $core_config['dlrd_limit']));
$j = 0;
for ($j = 0; $j < count($list); $j++) {
if ($id = $list[$j]['id']) {
$smslog_id = $list[$j]['smslog_id'];
$p_status = $list[$j]['p_status'];
$uid = $list[$j]['uid'];
if (dba_update(_DB_PREF_ . '_tblDLR', array('flag_processed' => 2), array('id' => $id))) {
logger_print("id:" . $id . " smslog_id:" . $smslog_id . " p_status:" . $p_status . " uid:" . $uid, 3, "dlrd");
setsmsdeliverystatus($smslog_id, $uid, $p_status);
}
}
}
}
示例10: myauto_hook_interceptincomingsms
function myauto_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
// reply message
$reply = 'Thank you for your message';
// detect reply message, set unicode if not ASCII
$unicode = 0;
if (function_exists('mb_detect_encoding')) {
$encoding = mb_detect_encoding($reply, 'auto');
if ($encoding != 'ASCII') {
$unicode = 1;
}
}
// send reply
list($ok, $to, $smslog_id) = sendsms_pv('admin', $sms_sender, $reply, 'text', $unicode);
// log it
$sms_datetime = core_display_datetime($sms_datetime);
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " autorespon:" . $reply, 3, "myauto");
}
示例11: notif_update
/**
* Update notification
* @param integer $uid User ID
* @param string $id Notification ID
* @param array $data Updated data
* @return boolean
*/
function notif_update($uid, $id, $data)
{
$ret = FALSE;
$replaced = '';
$db_table = _DB_PREF_ . '_tblNotif';
$result = dba_search($db_table, '*', array('uid' => $uid, 'id' => $id));
foreach ($result[0] as $key => $val) {
$items[$key] = $data[$key] ? $data[$key] : $val;
if ($data[$key]) {
$replaced = $key . ':' . $val . ' ';
}
}
if ($items && trim($replaced)) {
if (dba_update($db_table, $items, array('id' => $id))) {
logger_print('uid:' . $uid . ' id:' . $id . ' ' . trim($replaced), 2, 'notif_update');
$ret = TRUE;
}
}
return $ret;
}
示例12: sms_quiz_hook_recvsms_process
function sms_quiz_hook_recvsms_process($sms_datetime, $sms_sender, $quiz_keyword, $quiz_param = '', $sms_receiver = '', $smsc = '', $raw_message = '')
{
$ok = false;
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureQuiz WHERE quiz_keyword='{$quiz_keyword}'";
$db_result = dba_query($db_query);
if ($db_row = dba_fetch_array($db_result)) {
if ($db_row['uid'] && $db_row['quiz_enable']) {
$smsc = gateway_decide_smsc($smsc, $db_row['smsc']);
logger_print('begin k:' . $quiz_keyword . ' c:' . $quiz_param, 2, 'sms_quiz');
if (sms_quiz_handle($db_row, $sms_datetime, $sms_sender, $quiz_keyword, $quiz_param, $sms_receiver, $smsc, $raw_message)) {
$ok = true;
}
$status = $ok ? 'handled' : 'unhandled';
logger_print('end k:' . $quiz_keyword . ' c:' . $quiz_param . ' s:' . $status, 2, 'sms_quiz');
}
}
$ret['uid'] = $db_row['uid'];
$ret['status'] = $ok;
return $ret;
}
示例13: myauto_hook_interceptincomingsms
function myauto_hook_interceptincomingsms($sms_datetime, $sms_sender, $message, $sms_receiver)
{
global $core_config;
// reply message
$reply = 'Thank you for your message';
// detect reply message, set unicode if not ASCII
$unicode = 0;
if (function_exists('mb_detect_encoding')) {
$encoding = mb_detect_encoding($reply, 'auto');
if ($encoding != 'ASCII') {
$unicode = 1;
}
}
// send reply with admin account
$c_uid = username2uid('admin');
// send reply
sendsms($core_config['main']['cfg_gateway_number'], '', $sms_sender, $reply, $c_uid, 0, 'text', $unicode);
// log it
logger_print("dt:" . $sms_datetime . " s:" . $sms_sender . " r:" . $sms_receiver . " autorespon:" . $reply, 3, "myauto");
}
示例14: sms_custom_handle
function sms_custom_handle($c_uid, $sms_datetime, $sms_sender, $sms_receiver, $custom_keyword, $custom_param = '', $smsc = '', $raw_message = '')
{
$ok = false;
$custom_keyword = strtoupper(trim($custom_keyword));
$custom_param = trim($custom_param);
$db_query = "SELECT custom_url,uid,custom_return_as_reply FROM " . _DB_PREF_ . "_featureCustom WHERE custom_keyword='{$custom_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$custom_url = $db_row['custom_url'];
$username = user_uid2username($db_row['uid']);
$custom_return_as_reply = $db_row['custom_return_as_reply'];
if ($custom_keyword && $custom_url && $username) {
$sms_datetime = core_display_datetime($sms_datetime);
$custom_url = str_replace("{SMSDATETIME}", urlencode($sms_datetime), $custom_url);
$custom_url = str_replace("{SMSSENDER}", urlencode($sms_sender), $custom_url);
$custom_url = str_replace("{CUSTOMKEYWORD}", urlencode($custom_keyword), $custom_url);
$custom_url = str_replace("{CUSTOMPARAM}", urlencode($custom_param), $custom_url);
$custom_url = str_replace("{CUSTOMRAW}", urlencode($raw_message), $custom_url);
logger_print("custom_url:" . $custom_url, 3, "sms custom");
$parsed_url = parse_url($custom_url);
$opts = array('http' => array('method' => 'POST', 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'content' => $parsed_url['query']));
$context = stream_context_create($opts);
$server_url = explode('?', $custom_url);
$returns = file_get_contents($server_url[0], false, $context);
if ($custom_return_as_reply == 1) {
if ($returns = trim($returns)) {
$unicode = core_detect_unicode($returns);
$returns = addslashes($returns);
logger_print("returns:" . $returns, 3, "sms custom");
sendsms_helper($username, $sms_sender, $returns, 'text', $unicode, $smsc);
} else {
logger_print("returns empty", 3, "sms custom");
}
}
$ok = true;
}
return $ok;
}
示例15: sms_command_handle
function sms_command_handle($c_uid, $sms_datetime, $sms_sender, $sms_receiver, $command_keyword, $command_param = '', $smsc = '', $raw_message = '')
{
global $plugin_config;
$ok = false;
$command_keyword = strtoupper(trim($command_keyword));
$command_param = trim($command_param);
$db_query = "SELECT command_exec,uid,command_return_as_reply FROM " . _DB_PREF_ . "_featureCommand WHERE command_keyword='{$command_keyword}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$command_exec = $db_row['command_exec'];
$command_return_as_reply = $db_row['command_return_as_reply'];
$username = user_uid2username($db_row['uid']);
if ($command_keyword && $command_exec && $username) {
$sms_datetime = core_display_datetime($sms_datetime);
$command_exec = str_replace("{SMSDATETIME}", "\"{$sms_datetime}\"", $command_exec);
$command_exec = str_replace("{SMSSENDER}", escapeshellarg($sms_sender), $command_exec);
$command_exec = str_replace("{COMMANDKEYWORD}", escapeshellarg($command_keyword), $command_exec);
$command_exec = str_replace("{COMMANDPARAM}", escapeshellarg($command_param), $command_exec);
$command_exec = str_replace("{COMMANDRAW}", escapeshellarg($raw_message), $command_exec);
$command_exec = str_replace("/", "", $command_exec);
$command_exec = $plugin_config['sms_command']['bin'] . "/" . $db_row['uid'] . "/" . $command_exec;
$command_exec = escapeshellcmd($command_exec);
logger_print("command_exec:" . addslashes($command_exec), 3, "sms command");
$command_output = shell_exec($command_exec);
if ($command_return_as_reply == 1) {
$unicode = core_detect_unicode($command_output);
if ($command_output = addslashes(trim($command_output))) {
logger_print("command_output:" . $command_output, 3, "sms command");
sendsms_helper($username, $sms_sender, $command_output, 'text', $unicode, $smsc);
} else {
logger_print("command_output is empty", 3, "sms command");
}
}
$ok = true;
}
return $ok;
}