incr("alert_" . $type . $day . "_count"); if ($count >= $total) { $key = "alert_" . $type . "_" . $day; if (Redis::instance()->get($key)) { return true; } else { Redis::instance()->set($key, 1, 86400); $receipt = GlobalConfig::getData('recieve'); $subject = GlobalConfig::getData('subject'); $subject = sprintf($subject, $domain); $body = GlobalConfig::getData('body'); if ($log_file) { $attachment = ['path' => $log_file, 'name'=>sprintf('log[%s].txt',date("Y-m-d"))]; } else { $attachment = []; } Email::instance()->sendMail($receipt, $subject, $body, $attachment); } } } }