<?php
/*
* StatusNet - the distributed open-source microblogging tool
- *
+ *
* Handler for queue items of type 'sitesum', sends email summaries
* to all users on the site.
*
}
/**
- *
+ *
* Handler for queue items of type 'sitesum', sends email summaries
* to all users on the site.
*
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class SiteEmailSummaryHandler extends QueueHandler
{
-
/**
* Return transport keyword which identifies items this queue handler
* services; must be defined for all subclasses.
*
* @return string
*/
-
function transport()
{
return 'sitesum';
/**
* Handle the site
- *
+ *
* @param mixed $object
* @return boolean true on success, false on failure
*/
-
function handle($object)
{
- $qm = QueueManager::get();
+ $qm = QueueManager::get();
- try {
- // Enqueue a summary for all users
-
- $user = new User();
- $user->find();
-
- while ($user->fetch()) {
- try {
- $qm->enqueue($user->id, 'usersum');
- } catch (Exception $e) {
- common_log(LOG_WARNING, $e->getMessage());
- continue;
- }
- }
- } catch (Exception $e) {
- common_log(LOG_WARNING, $e->getMessage());
- }
-
- return true;
+ try {
+ // Enqueue a summary for all users
+
+ $user = new User();
+ $user->find();
+
+ while ($user->fetch()) {
+ try {
+ $qm->enqueue($user->id, 'usersum');
+ } catch (Exception $e) {
+ common_log(LOG_WARNING, $e->getMessage());
+ continue;
+ }
+ }
+ } catch (Exception $e) {
+ common_log(LOG_WARNING, $e->getMessage());
+ }
+
+ return true;
}
}
-