本文整理汇总了PHP中Timer::get_aeg方法的典型用法代码示例。如果您正苦于以下问题:PHP Timer::get_aeg方法的具体用法?PHP Timer::get_aeg怎么用?PHP Timer::get_aeg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::get_aeg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: auto_maillist
//.........这里部分代码省略.........
#$testrun_msg_arr[$msg_parent_id] = $msg_cnt;
$msg_cnt++;
}
}
######################
# meilide saatmine
$mail_ok_count = 0;
$mail_error_count = 0;
$mail_count = 0;
if (sizeof($meilid) > 0) {
$report_message .= "<b>Send news to:<br></b>";
foreach ($meilid as $to => $body) {
$send_status = 0;
if ($to != '' && $body != '') {
$send_status = check_mail_mx($clear_to[$to]);
if (!$test_run && $send_status) {
// send mail for each section
if ($site->CONF['mailinglist_sending_option'] == 1) {
foreach ($list as $section_id => $section) {
if (in_array($section_id, $subscribed[$to]) && sizeof($section['articles'])) {
$body = '';
foreach ($section['articles'] as $article) {
$body .= $article['content'];
}
if ($site->CONF['maillist_subject'] == 1) {
$subject = $section['title'] . ': ' . $article['title'];
} elseif ($site->CONF['maillist_subject'] == 2) {
$subject = $section['title'];
} elseif ($site->CONF['maillist_subject'] == 3) {
$subject = $article['title'];
} else {
$subject = $site->sys_sona(array(sona => 'Mailinglists: e-mail subject', tyyp => 'kasutaja', lang_id => $keel['glossary_id']));
$subject = str_replace('[Website name]', $site->CONF['site_name'], $subject);
}
$send_status = send_mailinglist_message($header, $body, $footer, $keel['encoding'], $subject, $to, $from);
}
}
} elseif ($site->CONF['mailinglist_sending_option'] == 2) {
foreach ($list as $section_id => $section) {
if (in_array($section_id, $subscribed[$to]) && sizeof($section['articles'])) {
foreach ($section['articles'] as $article) {
if ($site->CONF['maillist_subject'] == 1) {
$subject = $section['title'] . ': ' . $article['title'];
} elseif ($site->CONF['maillist_subject'] == 2) {
$subject = $section['title'];
} elseif ($site->CONF['maillist_subject'] == 3) {
$subject = $article['title'];
} else {
$subject = $site->sys_sona(array(sona => 'Mailinglists: e-mail subject', tyyp => 'kasutaja', lang_id => $keel['glossary_id']));
$subject = str_replace('[Website name]', $site->CONF['site_name'], $subject);
}
$send_status = send_mailinglist_message($header, $article['content'], $footer, $keel['encoding'], $subject, $to, $from);
}
}
}
} else {
$send_status = send_mailinglist_message($header, $body, $footer, $keel['encoding'], $subject[$to], $to, $from);
}
}
$report_message .= "<b>[" . $testrun_msg_arr[$body] . "]</b> ";
$report_message .= htmlspecialchars($to) . ($send_status ? "" : " <font color=red><b>bad mail</b></font>") . "<br>\n";
$mail_count++;
if ($send_status) {
$mail_ok_count++;
} else {
$mail_error_count++;
}
}
}
$report_message .= "<hr size=1><b>DEBUG ONLY: Mailinglists sent to " . $mail_count . " users. Successfully sent: " . $mail_ok_count . ", Error occurred during sending: " . $mail_error_count . ", Execution time: " . $exec_timer->get_aeg() . ".</b>";
if ($test_run) {
echo $report_message;
} elseif ($mail_count) {
$reporter_address = $site->CONF["maillist_reporter_address"];
if ($reporter_address) {
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=" . $keel['encoding'] . "\r\n";
$headers .= "From: " . $site->CONF["from_email"] . "\r\n";
mail($reporter_address, "Mailinglist report from site: " . $site->CONF["site_name"], wordwrap($report_message, 70), $headers);
}
}
}
# kui on, mida saata
# / meilide saatmine
######################
######################
# kirjuta log lõpetamisest
# ainult siis, kui mõni meil üldse saadeti
if ($mail_count && !$test_run) {
new Log(array('action' => 'send', 'component' => 'Mailinglist', 'user_id' => $is_pageloaded ? 0 : $site->user->id, 'message' => "Mailinglists sent to " . $mail_count . " users. Successfully sent: " . $mail_ok_count . ", Error occurred during sending: " . $mail_error_count . ", Execution time: " . $exec_timer->get_aeg()));
}
}
# while keel
if ($is_custom) {
$mailing_list['header'] = $header;
$mailing_list['footer'] = $footer;
$mailing_list['from'] = $from;
return $mailing_list;
}
}
示例2: array
/**
* load_aclpermissions
*
* returns all acl (group) permissions for guest (that means for group Everybody);
* returns 0 if failed;
* function is not called by default in site class but
* in edit-group-window and edit-user-window,
* also in all templates where any group or user info is used/printed/etc
*
*
* @package CMS
*
* @param -
*/
function load_aclpermissions()
{
$args = $this->args;
$perm = array();
$timer = new Timer();
# alustame m??????tmine
######### GET EVERYBODY GROUP
$grouptree = get_grouptree(array("group_id" => ''));
foreach ($grouptree as $key => $group) {
$group_names[] = $group['name'];
$group_arr[] = $group['id'];
$group_msg[] = $group['name'] . " (ID " . $group['id'] . ")";
}
$this->debug->msg("Guest group info: " . join(" => ", $group_msg));
######### LOAD ALL EVERYBODY GROUP PERMISSIONS: type ACL
$sql = $this->site->db->prepare("SELECT * FROM permissions WHERE type=? ", 'ACL');
$sql .= $this->site->db->prepare(" AND (group_id IN('" . join("','", $group_arr) . "') AND user_id=?)", 0);
#print $sql;
$sth = new SQL($sql);
$cemented_perm = array();
while ($permtmp = $sth->fetch('ASSOC')) {
$obj_id = $permtmp['source_id'];
if ($permtmp['group_id']) {
# group permission
$cemented_perm[$obj_id] = $permtmp;
}
}
$this->debug->msg("ACL permissions loaded: " . sizeof(array_keys($cemented_perm)) . " permissions found. Load time: " . $timer->get_aeg());
########### RETURN PERMISSIONS
return $cemented_perm;
}