exit(1);
}
+define('RSSCLOUDPLUGIN_VERSION', '0.1');
+
/**
* Plugin class for adding RSSCloud capabilities to StatusNet
*
// set defaults
- $local_server = parse_url(common_path('/main/rsscloud/request_notify'));
+ $local_server = parse_url(common_path('main/rsscloud/request_notify'));
if (empty($this->domain)) {
$this->domain = $local_server['host'];
}
if (empty($this->path)) {
- $this->path = '/main/rsscloud/request_notify';
+ $this->path = $local_server['path'];
}
if (empty($this->funct)) {
*
* Hook for RouterInitialized event.
*
+ * @param Mapper $m URL parser and mapper
+ *
* @return boolean hook return
*/
- function onRouterInitialized(&$m)
+ function onRouterInitialized($m)
{
- $m->connect('/main/rsscloud/request_notify', array('action' => 'RSSCloudRequestNotify'));
+ $m->connect('/main/rsscloud/request_notify',
+ array('action' => 'RSSCloudRequestNotify'));
- // XXX: This is just for end-to-end testing
- $m->connect('/main/rsscloud/notify', array('action' => 'LoggingAggregator'));
+ // XXX: This is just for end-to-end testing. Uncomment if you need to pretend
+ // to be a cloud hub for some reason.
+ //$m->connect('/main/rsscloud/notify',
+ // array('action' => 'LoggingAggregator'));
return true;
}
{
switch ($cls)
{
- case 'RSSCloudSubscription':
- include_once(INSTALLDIR . '/plugins/RSSCloud/RSSCloudSubscription.php');
+ case 'RSSCloudSubscription':
+ include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudSubscription.php';
return false;
- case 'RSSCloudNotifier':
- include_once(INSTALLDIR . '/plugins/RSSCloud/RSSCloudNotifier.php');
+ case 'RSSCloudNotifier':
+ include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudNotifier.php';
return false;
- case 'RSSCloudRequestNotifyAction':
- case 'LoggingAggregatorAction':
- include_once(INSTALLDIR . '/plugins/RSSCloud/' . mb_substr($cls, 0, -6) . '.php');
+ case 'RSSCloudQueueHandler':
+ include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudQueueHandler.php';
return false;
- default:
+ case 'RSSCloudRequestNotifyAction':
+ case 'LoggingAggregatorAction':
+ include_once INSTALLDIR . '/plugins/RSSCloud/' .
+ mb_substr($cls, 0, -6) . '.php';
+ return false;
+ default:
return true;
}
}
* Add a <cloud> element to the RSS feed (after the rss <channel>
* element is started).
*
- * @param Action $action
+ * @param Action $action the ApiAction
*
* @return void
*/
return true;
}
- /**
- * broadcast the message when not using queuehandler
- *
- * @param Notice &$notice the notice
- * @param array $queue destination queue
- *
- * @return boolean hook return
- */
-
- function onUnqueueHandleNotice(&$notice, $queue)
- {
- if (($queue == 'rsscloud') && ($this->_isLocal($notice))) {
-
- common_debug('broadcasting rssCloud bound notice ' . $notice->id);
-
- $profile = $notice->getProfile();
-
- $notifier = new RSSCloudNotifier();
- $notifier->notify($profile);
-
- return false;
- }
-
- return true;
- }
-
/**
* Determine whether the notice was locally created
*
- * @param Notice $notice
+ * @param Notice $notice the notice in question
*
* @return boolean locality
*/
* @return boolean hook return
*/
- function onCheckSchema() {
+ function onCheckSchema()
+ {
$schema = Schema::get();
$schema->ensureTable('rsscloud_subscription',
array(new ColumnDef('subscribed', 'integer',
null, false, null,
'CURRENT_TIMESTAMP',
'on update CURRENT_TIMESTAMP')
- )
- );
+ ));
return true;
}
/**
- * Add RSSCloudQueueHandler to the list of valid daemons to
- * start
+ * Register RSSCloud notice queue handler
*
- * @param array $daemons the list of daemons to run
+ * @param QueueManager $manager
*
* @return boolean hook return
- *
*/
+ function onEndInitializeQueueManager($manager)
+ {
+ $manager->connect('rsscloud', 'RSSCloudQueueHandler');
+ return true;
+ }
- function onGetValidDaemons($daemons)
+ function onPluginVersion(&$versions)
{
- array_push($daemons, INSTALLDIR .
- '/plugins/RSSCloud/RSSCloudQueueHandler.php');
+ $versions[] = array('name' => 'RSSCloud',
+ 'version' => RSSCLOUDPLUGIN_VERSION,
+ 'author' => 'Zach Copley',
+ 'homepage' => 'http://status.net/wiki/Plugin:RSSCloud',
+ 'rawdescription' =>
+ _m('The RSSCloud plugin enables your StatusNet instance to publish ' .
+ 'real-time updates for profile RSS feeds using the ' .
+ '<a href="http://rsscloud.org/">RSSCloud protocol</a>".'));
+
return true;
}