本文整理汇总了PHP中mylog函数的典型用法代码示例。如果您正苦于以下问题:PHP mylog函数的具体用法?PHP mylog怎么用?PHP mylog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mylog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: slack_incoming_hook_post_with_attachments
function slack_incoming_hook_post_with_attachments($uri, $user, $channel, $icon, $payload, $attachments)
{
$data = array("text" => $payload, "channel" => "#" . $channel, "username" => $user, "icon_url" => $icon, "attachments" => array($attachments));
$data_string = "payload=" . json_encode($data, JSON_HEX_AMP | JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT);
mylog('sent.txt', $data_string);
return curl_post($uri, $data_string);
}
示例2: toKFMsg
public function toKFMsg($kf_account = null)
{
$str = isset($kf_account) ? array('MsgType' => 'transfer_customer_service', 'TransInfo' => array('KfAccount' => $kf_account)) : array('MsgType' => 'transfer_customer_service');
$resultStr = $this->prepareMsg($str);
mylog($resultStr);
echo $resultStr;
return $resultStr;
}
示例3: mylog
<?php
function mylog($msg, $filename = 'pull')
{
error_log(date("Y-m-d H:i:s") . "\t" . $msg . PHP_EOL, 3, __DIR__ . DIRECTORY_SEPARATOR . $filename . '.log');
}
$serv = new swoole_server('0.0.0.0', 8999, SWOOLE_BASE, SWOOLE_SOCK_UDP);
$serv->set(['daemonize' => 1]);
$serv->on('Packet', function ($server, $_data, $client) {
$data = json_decode(trim($_data), true);
if (!empty($data[2])) {
system('cd ' . $data[2] . ' && git pull', $ret);
mylog($data[2] . ':' . $ret);
if ('laya-hook' == $data[0]) {
//重启
file_get_contents('http://127.0.0.1:9501/reload');
}
} else {
mylog($_data . ':' . strlen($_data));
}
});
$serv->start();
示例4: pdoInsert
function pdoInsert($tableName, $value, $str = '')
{
$sql = 'INSERT INTO ' . $tableName . ' SET ';
$j = 0;
$valueCount = count($value);
$data = '';
foreach ($value as $k => $v) {
$data .= $k . '=' . '"' . $v . '"';
if ($j < $valueCount - 1) {
$data = $data . ',';
}
$j++;
}
if ($str == 'ignore') {
$sql = preg_replace('/INTO/', $str, $sql);
$sql .= $data;
} elseif ($str == 'update') {
$sql .= $data . ' on DUPLICATE KEY update ' . $data;
} else {
$sql = $sql . $data . $str;
}
mylog($sql);
try {
$GLOBALS['pdo']->exec($sql);
return $GLOBALS['pdo']->lastInsertId();
} catch (PDOException $e) {
$error = 'Unable to insert to the database server.' . $e->getMessage();
return $error;
exit;
}
}
示例5: header
header("Expires: Sat, 1 Jan 2005 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
// no-cache headers - complete set
// these copied from [php.net/header][1], tested myself - works
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Some time in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
include_once "account.php";
if (!CookieAuthenticate($userid, $user_name)) {
echo "<font size=5 color=red>You need to login first !</font></h1>";
mylog($_POST["userid"], "view result login faiulre");
exit(-1);
}
$dir = $root_dir . $userid . "/current";
$real_dir = readlink($dir);
$file = $_GET["file"];
$file = substr($file, 0, strrpos($file, "."));
// error_log("show_text_file ".$dir.$file." ==> ".$real_dir.$file);
if ($file == "code") {
show_text_file($real_dir . $file, true);
} else {
show_text_file($real_dir . $file);
}
/*
$userid = $_GET["id"];
echo "<h1>Hi</h1>" ;
示例6: crawl
/**
* crawl the data
*/
function crawl($number)
{
$url = $this->issue_url . $number;
$content = file_get_contents($url);
$content = str_replace(["\r", "\n"], '', $content);
$pattern = '/<h4><a target="_blank" href="(.*?)">(.*?)<\\/a> <\\/h4>.*?<p>(.*?)<\\/p>/';
$rs = preg_match_all($pattern, $content, $matches);
if ($rs) {
mylog('crawl finished.start parsing');
$data = array();
foreach ($matches[1] as $key => $val) {
if (false !== strpos($matches[1][$key], 'job') || false !== strpos($matches[1][$key], 'amazon')) {
// get rid of job and book recommendations
continue;
}
$item = ['title' => strip_tags($matches[2][$key]), 'desc' => $matches[3][$key], 'href' => $val, 'number' => $number, 'hash' => md5($val)];
//加入数据库
$id = $this->add_cache($item);
$item['id'] = $id;
mylog("item {$id} added to cache");
// 加入数组
$data[] = $item;
}
return $data;
}
mylog('failed to crawl');
return false;
}
示例7: mysql_query
// удаление связей
$sql = "SELECT * FROM tz WHERE order_id='$delete'";
$res1 = mysql_query($sql);
while($rs1=mysql_fetch_array($res1)) {
// удаление
$delete = $rs1["id"];
$sql = "DELETE FROM tz WHERE id='$delete'";
mylog('tz',$delete);
mysql_query($sql);
// удаление связей
$sql = "SELECT * FROM posintz WHERE tz_id='$delete'";
$res = mysql_query($sql);
while($rs=mysql_fetch_array($res)) {
$delete = $rs["id"];
$sql = "DELETE FROM posintz WHERE id='$delete'";
mylog('posintz',$delete);
mysql_query($sql);
}
}
}
}
else
{
// вывести таблицу
// sql
$sql="SELECT * FROM customers ".(isset($find)?"WHERE (customers.customer LIKE '%$find%' OR customers.fullname LIKE '%$find%' ) ":"").(isset($order)?"ORDER BY ".$order." ":"ORDER BY customers.customer ").(isset($all)?"":"LIMIT 20");
//print $sql;
$type="customers";
$cols[id]="ID";
$cols[customer]="Заказчик";
$cols[fullname]="Полное название";
示例8: error_reporting
<?php
/*
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set('display_startup_errors', 1);
ini_set("log_errors",1);
ini_set("display_errors",1);
ini_set("error_log", "/path/to/a/log/file/php_error.log");
*/
include_once "../config.php";
include_once '../account.php';
include_once "authenticate.php";
if (Authenticate($_POST["userid"], $_POST["userpwd"], $users) == FALSE) {
echo "<h1><font size=5 color=red>Login failed !</font></h1>";
// if (array_key_exists($_POST["userid"], $users) )
mylog($_POST["userid"], "old faithful login faiulre");
exit(-1);
}
///////////////check password update date ////////////////
$pwd_update_time = LastPWDUpdateTime($_POST["userid"]);
if (time() - $pwd_update_time > 86400 * 365) {
echo "<h1><font size=5 color=red>Your last password change was at " . date("Y-m-d H:i:s", $pwd_update_time) . "</font></h1>";
echo "<h1><font size=5 color=green>You have to change your password first !</font></h1>";
echo '<iframe src="change_pwd.html" frameborder=0 height="100%" width="100%">Please enable iframe on your browser !</iframe>';
exit(-1);
}
///////////////////////////////////////////////////////
$record = GetUserRecordByID($_POST["userid"]);
$dir = $root_dir . $record["id"] . "/current/";
$user_name = $record["name"];
echo "<h1><font size=4 color=green>Submission Info for " . $record["id"] . " {$user_name}<br/><br/></font></h1>";
示例9: check_login_interval
function check_login_interval()
{
global $g5;
$sql = "select * from {$g5['login_table']} where ghost='ghost' order by lo_datetime desc limit 1";
$rt = sql_query($sql);
$num = sql_num_rows($rt);
if ($num) {
$row = sql_fetch($sql);
$last_login_dt = $row['lo_datetime'];
$d1 = new DateTime($last_login_dt);
$d2 = new DateTime(date("Y-m-d H:i:s"));
mylog($last_login_dt, "last login dt");
mylog(date("Y-m-d H:i:s"), "now");
mylog($d1->getTimestamp(), "time");
mylog($d2->getTimestamp(), "time");
//$d3 = $d1->diff($d2);
//$diff_min = (int) $d3->i;
$d1_time = $d1->getTimestamp();
$d2_time = $d2->getTimestamp();
$diff_sec = $d2_time - $d1_time;
mylog($diff_sec, "diff sec");
if ($diff_sec >= $this->login_interval * 60) {
return true;
} else {
return false;
}
} else {
return true;
}
}
示例10: table_day_gen
function table_day_gen($date)
{
mylog("table day gen was called for {$date}");
//This pulls the info for $date to display inside the table
$db_server = mysqli_connect("localhost", "root", "root", "schedule");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit;
}
//Queries
$cycledayvaluequery = "SELECT cycleday FROM days WHERE daate = '{$date}';";
$activevaluequery = "SELECT active FROM days WHERE daate = '{$date}';";
$specialquery = "SELECT specialsched FROM days WHERE daate = '{$date}';";
mylog("Queries are: {$cycledayvaluequery}, {$activevaluequery}, {$specialquery}");
//Running Queries
//results will be: $active_result, $cyc_result, and $spec_result
//cycle query
$result_of_cycle_query = mysqli_query($db_server, $cycledayvaluequery);
//mylog('ran the inactive day query');
if ($result_of_cycle_query->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
//And when pulling a row, use this part
}
$cycrow = mysqli_fetch_array($result_of_cycle_query, MYSQLI_ASSOC);
$cyc_result = $cycrow["cycleday"];
mylog("cyc result for {$date} returned {$cyc_result}");
//active query
$result_of_active_query = mysqli_query($db_server, $activevaluequery);
//mylog('ran the inactive day query');
if ($result_of_active_query->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
//And when pulling a row, use this part
}
$activerow = mysqli_fetch_array($result_of_active_query, MYSQLI_ASSOC);
$active_result = $activerow["active"];
mylog("active result for {$date} returned {$active_result}");
//special query
$result_of_spec_query = mysqli_query($db_server, $specialquery);
//mylog('ran the inactive day query');
if ($result_of_spec_query->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
//And when pulling a row, use this part
}
$specrow = mysqli_fetch_array($result_of_spec_query, MYSQLI_ASSOC);
$spec_result = $specrow["specialsched"];
mylog("spec result for {$date} returned {$active_result}");
//creating the cell:
$cellforthisday = "<td> {$date} {$active_result} </br> {$cyc_result} {$spec_result} </td>";
//$cellforthisday = ${'cellfor'.$date};
return $cellforthisday;
}
示例11: action_index
function action_index()
{
include './php/conn.php';
mylog('Start Constructor');
}
示例12: createButtonTemp
exit;
}
//公众号操作
if (isset($_GET['wechat'])) {
include_once '../wechat/serveManager.php';
if (isset($_GET['createButton'])) {
createButtonTemp();
exit;
}
if (isset($_GET['sendTemplateMsg'])) {
// mylog($re);
exit;
}
}
if (isset($_GET['imgUpdate'])) {
mylog('update');
}
if (isset($_GET['goodsSituation'])) {
pdoUpdate('g_inf_tbl', array('situation' => $_GET['goodsSituation']), array('id' => $_GET['g_id']));
$g_id = $_GET['g_id'];
header('location:index.php?goods-config=1&g_id=' . $g_id);
exit;
}
if (isset($_GET['updateParm'])) {
$value['g_id'] = $_GET['g_id'];
foreach ($_POST as $k => $v) {
$value[$k] = $v;
}
pdoInsert('parameter_tbl', $value, 'update');
$g_id = $_GET['g_id'];
header('location:index.php?goods-config=1&g_id=' . $g_id);
示例13: bg_unzip_move_and_mconvert
function bg_unzip_move_and_mconvert($mapping, $dir, $ticket)
{
global $base_url;
$module_path = DRUPAL_ROOT . DIRECTORY_SEPARATOR . drupal_get_path('module', 'editcol');
$script = $module_path . DIRECTORY_SEPARATOR . 'unzip.php' . ' ' . $dir . ' ' . $ticket;
$drupal_dir = DRUPAL_ROOT;
$cmd = "/usr/bin/drush -q -l {$base_url} -r {$drupal_dir} php-script {$script} &";
mylog($cmd, 'cmd.txt');
variable_set("mapping_for_unzip_{$ticket}", $mapping);
// invoke unzip.php at background, it will get this variable to do the unzip
$ret_code = proc_close(proc_open($cmd, array(), $foo));
// no blocking, run at background
if ($ret_code == -1) {
drupal_set_message("bg_unzip_move_and_mconvert(): external command error!!");
}
}
示例14: pdoQuery
$temp = pdoQuery('g_image_tbl', null, array('g_id' => $_GET['g_id']), 'limit 1');
if (!($row = $temp->fetch())) {
pdoInsert('g_image_tbl', array('g_id' => $_GET['g_id'], 'url' => $inf['url'], 'remark' => $inf['md5']), 'ignore');
mylog("create record");
} else {
pdoUpdate('g_image_tbl', array('remark' => $inf['md5'], 'url' => $inf['url']), array('g_id' => $_GET['g_id']));
$query = pdoQuery('image_view', null, array('remark' => $row['remark']), ' limit 1');
if (!($t = $query->fetch())) {
unlink('../' . $row['url']);
mylog('unlink"../' . $row['url']);
} else {
mylog('not unlink');
}
}
}
mylog($jsonInf);
echo $jsonInf;
exit;
}
// if (isset($_GET['g_id'])){
//
// }
// if (isset($_POST['g_id']) && $_POST['g_id'] != '-1') {
// $file = $_FILES['spic'];
// $inf = '';
// for ($i = 0; $i < count($file['name']); $i++) {
// if ((($file["type"][$i] == "image/png")
// || ($file["type"][$i] == "image/jpeg")
// || ($file["type"][$i] == "image/pjpeg"))
// && ($file["size"][$i] < 500000)
// ) {
示例15: authorize
<?
// Отображает запущенные платы
include_once $GLOBALS["DOCUMENT_ROOT"]."/lib/sql.php";
authorize(); // вызов авторизации
if (isset($delete))
{
// удаление
$sql = "UPDATE conductors SET ts=NOW(), user_id='$userid', ready='1' WHERE id='$delete'";
mylog('conductors',$delete);
mysql_query($sql);
}
elseif (isset($show) || isset($edit)|| isset($add) )
{
if (!isset($accept) ) {
$id=isset($show)?$id:(isset($edit)?$edit:$add);
$r = getright($user);
echo "<form method=post id=editform>";
if ($edit!=0) {
$sql="SELECT *, customers.id AS cusid, conductors.board_id AS plid FROM conductors JOIN (customers,plates) ON (conductors.board_id=plates.id AND plates.customer_id=customers.id) WHERE conductors.id='$edit'";
$res = mysql_query($sql);
if ($rs=mysql_fetch_array($res)) {
$customer=$rs["cusid"];
$plid = $rs["plid"];
$side = $rs["side"];
$pib=$rs["pib"];
$lays=$rs["lays"];
echo "Заказчик:<input type=input readonly style='background-color:gray;' value='".$rs["customer"]."'><br>";