summaryrefslogtreecommitdiff
path: root/plugins/RSSCloud/RSSCloudPlugin.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-12-11 17:50:10 -0800
committerZach Copley <zach@status.net>2010-01-05 23:19:13 -0800
commit48af79dbb4cf1b4f915bf0d3d05e9fe3770664df (patch)
treed6fbebf48b83db0d9cf1bb66605fd02996980dc2 /plugins/RSSCloud/RSSCloudPlugin.php
parentc571c1323f3ff42baa31dd4f008d2417ac0f0e76 (diff)
Added a bunch of function commment blocks
Diffstat (limited to 'plugins/RSSCloud/RSSCloudPlugin.php')
-rw-r--r--plugins/RSSCloud/RSSCloudPlugin.php63
1 files changed, 60 insertions, 3 deletions
diff --git a/plugins/RSSCloud/RSSCloudPlugin.php b/plugins/RSSCloud/RSSCloudPlugin.php
index fcd468f55..8c0bfa904 100644
--- a/plugins/RSSCloud/RSSCloudPlugin.php
+++ b/plugins/RSSCloud/RSSCloudPlugin.php
@@ -31,15 +31,35 @@ if (!defined('STATUSNET')) {
exit(1);
}
-define('RSSCLOUDPLUGIN_VERSION', '0.1');
+/**
+ * Plugin class for adding RSSCloud capabilities to StatusNet
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ **/
class RSSCloudPlugin extends Plugin
{
+ /**
+ * Our friend, the constructor
+ *
+ * @return void
+ */
function __construct()
{
parent::__construct();
}
+ /**
+ * Setup the info for the subscription handler. Allow overriding
+ * to point at another cloud hub (not currently used).
+ *
+ * @return void
+ */
+
function onInitializePlugin()
{
$this->domain = common_config('rsscloud', 'domain');
@@ -91,6 +111,16 @@ class RSSCloudPlugin extends Plugin
return true;
}
+ /**
+ * Automatically load the actions and libraries used by
+ * the RSSCloud plugin
+ *
+ * @param Class $cls the class
+ *
+ * @return boolean hook return
+ *
+ */
+
function onAutoload($cls)
{
switch ($cls)
@@ -110,10 +140,17 @@ class RSSCloudPlugin extends Plugin
}
}
+ /**
+ * Add a <cloud> element to the RSS feed (after the rss <channel>
+ * element is started).
+ *
+ * @param Action $action
+ *
+ * @return void
+ */
+
function onStartApiRss($action)
{
- // XXX: Add RSS 1.0 user feeds
-
if (get_class($action) == 'ApiTimelineUserAction') {
$attrs = array('domain' => $this->domain,
@@ -141,6 +178,7 @@ class RSSCloudPlugin extends Plugin
*
* @return boolean hook return
*/
+
function onStartEnqueueNotice($notice, &$transports)
{
array_push($transports, 'rsscloud');
@@ -155,6 +193,7 @@ class RSSCloudPlugin extends Plugin
*
* @return boolean hook return
*/
+
function onUnqueueHandleNotice(&$notice, $queue)
{
if (($queue == 'rsscloud') && ($this->_isLocal($notice))) {
@@ -179,12 +218,20 @@ class RSSCloudPlugin extends Plugin
*
* @return boolean locality
*/
+
function _isLocal($notice)
{
return ($notice->is_local == Notice::LOCAL_PUBLIC ||
$notice->is_local == Notice::LOCAL_NONPUBLIC);
}
+ /**
+ * Create the rsscloud_subscription table if it's not
+ * already in the DB
+ *
+ * @return boolean hook return
+ */
+
function onCheckSchema() {
$schema = Schema::get();
$schema->ensureTable('rsscloud_subscription',
@@ -205,6 +252,16 @@ class RSSCloudPlugin extends Plugin
return true;
}
+ /**
+ * Add RSSCloudQueueHandler to the list of valid daemons to
+ * start
+ *
+ * @param array $daemons the list of daemons to run
+ *
+ * @return boolean hook return
+ *
+ */
+
function onGetValidDaemons($daemons)
{
array_push($daemons, INSTALLDIR .