本文整理汇总了PHP中sys::log方法的典型用法代码示例。如果您正苦于以下问题:PHP sys::log方法的具体用法?PHP sys::log怎么用?PHP sys::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sys
的用法示例。
在下文中一共展示了sys::log方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onOpenLimit
function onOpenLimit($sendNotice = true)
{
global $cfg;
//Log the limit notice as a warning for admin.
$msg = sprintf('Max open tickets (%d) reached for %s ', $cfg->getMaxOpenTickets(), $this->getEmail());
sys::log(LOG_WARNING, 'Max. Open Tickets Limit (' . $this->getEmail() . ')', $msg);
if (!$sendNotice || !$cfg->sendOverlimitNotice()) {
return true;
}
//Send notice to user.
$dept = $this->getDept();
if (!$dept || !($tpl = $dept->getTemplate())) {
$tpl = $cfg->getDefaultTemplate();
}
if (!$dept || !($email = $dept->getAutoRespEmail())) {
$email = $cfg->getDefaultEmail();
}
if ($tpl && ($msg = $tpl->getOverlimitMsgTemplate()) && $email) {
$body = $this->replaceTemplateVars($msg['body']);
$subj = $this->replaceTemplateVars($msg['subj']);
$body = str_replace('%signature', $dept && $dept->isPublic() ? $dept->getSignature() : '', $body);
$email->send($this->getEmail(), $subj, $body);
}
$client = $this->getClient();
//Alert admin...this might be spammy (no option to disable)...but it is helpful..I think.
$msg = 'Max. open tickets reached for ' . $this->getEmail() . "\n" . 'Open ticket: ' . $client->getNumOpenTickets() . "\n" . 'Max Allowed: ' . $cfg->getMaxOpenTickets() . "\n\nNotice sent to the user.";
Sys::alertAdmin('Overlimit Notice', $msg);
return true;
}