X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FRSSCloud%2FRSSCloudQueueHandler.php;h=8a09977489b3d463d41f0b14d1568470ae532b81;hb=324fada5ea80ece851a2481127a5cbd5732e171f;hp=693dd27c1f714f350a009422b5d10c4dcebb6b45;hpb=a55939f3b1540cf86b6edcf4f0c8ff79fb5f6a20;p=quix0rs-gnu-social.git diff --git a/plugins/RSSCloud/RSSCloudQueueHandler.php b/plugins/RSSCloud/RSSCloudQueueHandler.php old mode 100755 new mode 100644 index 693dd27c1f..8a09977489 --- a/plugins/RSSCloud/RSSCloudQueueHandler.php +++ b/plugins/RSSCloud/RSSCloudQueueHandler.php @@ -1,4 +1,3 @@ -#!/usr/bin/env php . */ -define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..')); - -$shortoptions = 'i::'; -$longoptions = array('id::'); - -$helptext = <<log(LOG_INFO, "INITIALIZE"); - $this->notifier = new RSSCloudNotifier(); - return true; - } - - function handle_notice($notice) + function handle($notice) { - $profile = $notice->getProfile(); - return $this->notifier->notify($profile); + try { + $profile = $notice->getProfile(); + } catch (Exception $e) { + common_log(LOG_ERR, "Dropping RSSCloud item for notice with bogus profile: " . $e->getMessage()); + return true; + } + $notifier = new RSSCloudNotifier(); + return $notifier->notify($profile); } - - function finish() - { - } - } - -if (have_option('i')) { - $id = get_option_value('i'); -} else if (have_option('--id')) { - $id = get_option_value('--id'); -} else if (count($args) > 0) { - $id = $args[0]; -} else { - $id = null; -} - -$handler = new RSSCloudQueueHandler($id); - -$handler->runOnce();