diff options
author | Zach Copley <zach@status.net> | 2009-11-04 17:32:17 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-01-05 22:59:42 -0800 |
commit | 8980bebcb38eaaca934141b1828e243609577a51 (patch) | |
tree | 5f1799c2d3897574b0e870f8b5a4f4722335bb12 /plugins/RSSCloud/RSSCloudPlugin.php | |
parent | aa9f81193e9f623dec136c6c5b7ddd6ebb948ab0 (diff) |
Add a table and DB_DataObject class for storing cloud subscriptions
Diffstat (limited to 'plugins/RSSCloud/RSSCloudPlugin.php')
-rw-r--r-- | plugins/RSSCloud/RSSCloudPlugin.php | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/plugins/RSSCloud/RSSCloudPlugin.php b/plugins/RSSCloud/RSSCloudPlugin.php index 816739889..10f81b8dd 100644 --- a/plugins/RSSCloud/RSSCloudPlugin.php +++ b/plugins/RSSCloud/RSSCloudPlugin.php @@ -95,14 +95,15 @@ class RSSCloudPlugin extends Plugin { switch ($cls) { - + case 'RSSCloudSubscription': + include_once(INSTALLDIR . '/plugins/RSSCloud/RSSCloudSubscription.php'); + return false; case 'RSSCloudNotifier': - require_once(INSTALLDIR . '/plugins/RSSCloud/RSSCloudNotifier.php'); + include_once(INSTALLDIR . '/plugins/RSSCloud/RSSCloudNotifier.php'); return false; case 'RSSCloudRequestNotifyAction': case 'LoggingAggregatorAction': - common_debug(mb_substr($cls, 0, -6) . '.php'); - require_once(INSTALLDIR . '/plugins/RSSCloud/' . mb_substr($cls, 0, -6) . '.php'); + include_once(INSTALLDIR . '/plugins/RSSCloud/' . mb_substr($cls, 0, -6) . '.php'); return false; default: return true; @@ -155,10 +156,10 @@ class RSSCloudPlugin extends Plugin function onUnqueueHandleNotice(&$notice, $queue) { if (($queue == 'rsscloud') && ($this->_isLocal($notice))) { - + // broadcast the notice here common_debug('broadcasting rssCloud bound notice ' . $notice->id); - + return false; } return true; @@ -176,6 +177,24 @@ class RSSCloudPlugin extends Plugin return ($notice->is_local == Notice::LOCAL_PUBLIC || $notice->is_local == Notice::LOCAL_NONPUBLIC); } - + + + function onCheckSchema() { + $schema = Schema::get(); + $schema->ensureTable('rsscloud_subscription', + array(new ColumnDef('subscribed', 'integer', + null, false, 'PRI'), + new ColumnDef('url', 'varchar', + '255', false, 'PRI'), + new ColumnDef('failures', 'integer', + null, false, 'MUL'), + new ColumnDef('created', 'datetime', + null, false), + new ColumnDef('modified', 'timestamp') + ) + ); + return true; + } + } |