From 44c72b132a7f4a168f2bc65c75aa564cc0608f80 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Tue, 13 Dec 2011 08:19:37 +0000 Subject: [PATCH] Update processor to run only configured source plugins Grab a list of enabled plugins and iterate through, rather than grabbing a list of all plugins and attempting to match against the enabled ones. --- source/lib/DownloadDispatcher/Processor.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/lib/DownloadDispatcher/Processor.class.php b/source/lib/DownloadDispatcher/Processor.class.php index e7a766d..a5b7ac5 100644 --- a/source/lib/DownloadDispatcher/Processor.class.php +++ b/source/lib/DownloadDispatcher/Processor.class.php @@ -23,7 +23,7 @@ class DownloadDispatcher_Processor { $plugin = DownloadDispatcher_Sync_PluginFactory::create($plugin_name, $config, $log, $instance); $plugin->run(); - } catch(SihnonFramework_Exception_LogException $e) { + } catch(SihnonFramework_Exception_PluginException $e) { SihnonFramework_LogEntry::warning($log, $e->getMessage()); } } @@ -31,13 +31,14 @@ class DownloadDispatcher_Processor { // Find the list of available source plugins DownloadDispatcher_Source_PluginFactory::scan(); - $source_plugins = DownloadDispatcher_Source_PluginFactory::getValidPlugins(); - - $enabled_plugins = $config->get('sources'); + $source_plugins = $config->get('sources'); foreach ($source_plugins as $plugin_name) { - if (in_array($plugin_name, $enabled_plugins)) { + try { $plugin = DownloadDispatcher_Source_PluginFactory::create($plugin_name, $config, $log); $plugin->run(); + + } catch(DownloadDispatcher_Exception_PluginException $e) { + SihnonFramework_LogEntry::warning($log, $e->getMessage()); } } }