From: Florent Bruneau Date: Sat, 19 Jun 2010 09:26:30 +0000 (+0200) Subject: Increase memory_limit in notifs.send. X-Git-Tag: xorg/1.0.0~116 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=8c2640f60951177740b7f601fda70faa119fea1c;p=platal.git Increase memory_limit in notifs.send. Also do a bit of rewrite in order to limit instantiation of $user->profile() for informations that are present in the user object. Use PlMailer::sendTo() that set automatically the Recipient and the format of the mail (update core to use version that uses PlMailer::setTo). Signed-off-by: Florent Bruneau --- diff --git a/bin/cron/notifs.send.php b/bin/cron/notifs.send.php index 939b558..73b5a73 100755 --- a/bin/cron/notifs.send.php +++ b/bin/cron/notifs.send.php @@ -32,16 +32,17 @@ $iterator = User::iterOverUIDs($uids->fetchColumn()); $mailer = new PlMailer('carnet/notif.mail.tpl'); while($user = $iterator->next()) { - if (Watch::getCount($user) > 0) { - $notifs = Watch::getEvents($user, time() - (7 * 86400)); - $mailer->assign('sex', $user->profile()->isFemale()); - $mailer->assign('yourself', $user->profile()->yourself); + $watch = new Watch($user); + if ($watch->count() > 0) { + $notifs = $watch->events(); + $mailer->assign('sex', $user->isFemale()); + $mailer->assign('yourself', $user->display_name); $mailer->assign('week', date('W - Y')); $mailer->assign('notifs', $notifs); - $mailer->addTo('"' . $user->full_name . '" <' . $user->bestalias . '>'); - $mailer->send($user->email_format == 'html'); + $mailer->sendTo($user); unset($notifs); } + unset($watch); unset($user); } diff --git a/core b/core index bbeb39f..7418556 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit bbeb39f78c0e4a7fbcc745c5c905de52d71f8b38 +Subproject commit 7418556c91a5d8e81e23d9a335fbc3a5623a4079