X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FRSSCloud%2FRSSCloudPlugin.php;h=0fff0947a288020217dd4c9d56fd39013ed312e6;hb=9dc8250956a25dc7f06f0d81d135b837cfe8281a;hp=001106aceceb4606b2a4e3a741bb90351720b704;hpb=53650c7a5e8f2a27f8d0d02367bda8934f59c0e6;p=quix0rs-gnu-social.git diff --git a/plugins/RSSCloud/RSSCloudPlugin.php b/plugins/RSSCloud/RSSCloudPlugin.php index 001106acec..0fff0947a2 100644 --- a/plugins/RSSCloud/RSSCloudPlugin.php +++ b/plugins/RSSCloud/RSSCloudPlugin.php @@ -41,8 +41,7 @@ define('RSSCLOUDPLUGIN_VERSION', '0.1'); * @author Zach Copley * @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 { /** @@ -61,7 +60,6 @@ class RSSCloudPlugin extends Plugin * * @return void */ - function onInitializePlugin() { $this->domain = common_config('rsscloud', 'domain'); @@ -100,11 +98,10 @@ class RSSCloudPlugin extends Plugin * * Hook for RouterInitialized event. * - * @param Mapper &$m URL parser and mapper + * @param Mapper $m URL parser and mapper * * @return boolean hook return */ - function onRouterInitialized($m) { $m->connect('/main/rsscloud/request_notify', @@ -118,39 +115,6 @@ 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) - { - case 'RSSCloudSubscription': - include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudSubscription.php'; - return false; - case 'RSSCloudNotifier': - include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudNotifier.php'; - return false; - case 'RSSCloudQueueHandler': - include_once INSTALLDIR . '/plugins/RSSCloud/RSSCloudQueueHandler.php'; - return false; - case 'RSSCloudRequestNotifyAction': - case 'LoggingAggregatorAction': - include_once INSTALLDIR . '/plugins/RSSCloud/' . - mb_substr($cls, 0, -6) . '.php'; - return false; - default: - return true; - } - } - /** * Add a element to the RSS feed (after the rss * element is started). @@ -159,7 +123,6 @@ class RSSCloudPlugin extends Plugin * * @return void */ - function onStartApiRss($action) { if (get_class($action) == 'ApiTimelineUserAction') { @@ -192,24 +155,12 @@ class RSSCloudPlugin extends Plugin function onStartEnqueueNotice($notice, &$transports) { - array_push($transports, 'rsscloud'); + if ($notice->isLocal()) { + array_push($transports, 'rsscloud'); + } return true; } - /** - * Determine whether the notice was locally created - * - * @param Notice $notice the notice in question - * - * @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 @@ -221,19 +172,16 @@ class RSSCloudPlugin extends Plugin { $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, null, 0), - new ColumnDef('created', 'datetime', - null, false), - new ColumnDef('modified', 'timestamp', - null, false, null, - 'CURRENT_TIMESTAMP', - 'on update CURRENT_TIMESTAMP') - )); + array( + 'fields' => array( + 'subscribed' => array('type' => 'int', 'not null' => true), + 'url' => array('type' => 'varchar', 'length' => '191', 'not null' => true), + 'failures' => array('type' => 'int', 'not null' => true, 'default' => 0), + 'created' => array('type' => 'datetime', 'not null' => true), + 'modified' => array('type' => 'timestamp', 'not null' => true), + ), + 'primary key' => array('subscribed', 'url'), + )); return true; } @@ -250,19 +198,18 @@ class RSSCloudPlugin extends Plugin return true; } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'RSSCloud', 'version' => RSSCLOUDPLUGIN_VERSION, 'author' => 'Zach Copley', 'homepage' => 'http://status.net/wiki/Plugin:RSSCloud', 'rawdescription' => + // TRANS: Plugin description. _m('The RSSCloud plugin enables your StatusNet instance to publish ' . 'real-time updates for profile RSS feeds using the ' . - 'RSSCloud protocol".')); + 'RSSCloud protocol.')); return true; } - } -