本文整理汇总了PHP中logger::sql方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::sql方法的具体用法?PHP logger::sql怎么用?PHP logger::sql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger
的用法示例。
在下文中一共展示了logger::sql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
function query($sql, $is_read = true)
{
$result = mysql_query($sql, self::$conn[$this->i]);
$log = config('log', 'mysql');
$log['is_record_sql'] and logger::sql($sql, $is_read);
if ($result) {
return $result;
}
$info = $sql . ' {' . mysql_error() . '}';
$log['is_record_exception'] and logger::exception('mysql', $info);
throw new Exception($info, 104);
}
示例2: empty
$MessageGroupId = empty($mid) ? $appmsgid : $mid;
}
if (empty($MessageGroupId)) {
$MessageGroupId = 'null';
}
if (empty($commMsgInfoId)) {
$commMsgInfoId = 'null';
}
$sql = "\nINSERT INTO babysitter_weixin_message_info_fetch_history\n(weixin_id, comm_msg_info_id, message_group_id, message_item_index, is_multi, title, content_url, publish_time, read_num, like_num, fetched_time)\nVALUES\n(\n'{$weixinID}'\n, {$commMsgInfoId}\n, {$MessageGroupId}\n, {$msgInfoOneEntry->MessageItemIndex}\n, {$isMulti}\n, '{$title}'\n, '{$contentURL}'\n, from_unixtime({$msgInfoOneEntry->PublishTimestamp})\n, {$readNum}\n, {$likeNum}\n, from_unixtime({$msgInfoOneEntry->CrawlTimestamp})\n);\n ";
$sqlList[] = trim(preg_replace("/[\\r\\n]/", " ", $sql));
}
$dbLink->close();
$sqlOutput = PHP_EOL . implode(PHP_EOL, $sqlList);
logger::sql($sqlOutput);
logger::sql(PHP_EOL);
logger::sql("\nset session sql_safe_updates = 0;\nupdate babysitter_weixin_message_info_fetch_history h left join babysitter_account a on a.weibo_id = h.weixin_id and a.weibo_type = 9 set h.account_id = a.account_id where h.account_id is null;\n");
logger::info($sqlOutput);
logger::info("END.");
class utils
{
public static function removeNonUtf8($string)
{
$regex = <<<'END'
/
(
(?: [\x00-\x7F] # single-byte sequences 0xxxxxxx
| [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
| [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
| [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
){1,100} # ...one or more times
)