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.
This commit is contained in:
2011-12-13 08:19:37 +00:00
parent 058de7266c
commit 44c72b132a

View File

@@ -23,7 +23,7 @@ class DownloadDispatcher_Processor {
$plugin = DownloadDispatcher_Sync_PluginFactory::create($plugin_name, $config, $log, $instance); $plugin = DownloadDispatcher_Sync_PluginFactory::create($plugin_name, $config, $log, $instance);
$plugin->run(); $plugin->run();
} catch(SihnonFramework_Exception_LogException $e) { } catch(SihnonFramework_Exception_PluginException $e) {
SihnonFramework_LogEntry::warning($log, $e->getMessage()); SihnonFramework_LogEntry::warning($log, $e->getMessage());
} }
} }
@@ -31,13 +31,14 @@ class DownloadDispatcher_Processor {
// Find the list of available source plugins // Find the list of available source plugins
DownloadDispatcher_Source_PluginFactory::scan(); DownloadDispatcher_Source_PluginFactory::scan();
$source_plugins = DownloadDispatcher_Source_PluginFactory::getValidPlugins(); $source_plugins = $config->get('sources');
$enabled_plugins = $config->get('sources');
foreach ($source_plugins as $plugin_name) { foreach ($source_plugins as $plugin_name) {
if (in_array($plugin_name, $enabled_plugins)) { try {
$plugin = DownloadDispatcher_Source_PluginFactory::create($plugin_name, $config, $log); $plugin = DownloadDispatcher_Source_PluginFactory::create($plugin_name, $config, $log);
$plugin->run(); $plugin->run();
} catch(DownloadDispatcher_Exception_PluginException $e) {
SihnonFramework_LogEntry::warning($log, $e->getMessage());
} }
} }
} }