Initial commit
Basic framework for application including two sample plugins: TV and RouterboardFirmware.
This commit is contained in:
30
source/lib/DownloadDispatcher/Source/PluginFactory.class.php
Normal file
30
source/lib/DownloadDispatcher/Source/PluginFactory.class.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class DownloadDispatcher_Source_PluginFactory extends DownloadDispatcher_PluginFactory {
|
||||
|
||||
protected static $plugin_prefix = 'DownloadDispatcher_Source_Plugin_';
|
||||
protected static $plugin_interface = 'DownloadDispatcher_Source_IPlugin';
|
||||
protected static $plugin_dir = array(
|
||||
DownloadDispatcher_Lib => 'DownloadDispatcher/Source/Plugin/',
|
||||
);
|
||||
|
||||
|
||||
public static function init() {
|
||||
|
||||
}
|
||||
|
||||
public static function create($plugin, SihnonFramework_Config $config, SihnonFramework_Log $log) {
|
||||
self::ensureScanned();
|
||||
|
||||
if (! self::isValidPlugin($plugin)) {
|
||||
throw new Sihnon_Exception_InvalidPluginName($plugin);
|
||||
}
|
||||
|
||||
$classname = self::classname($plugin);
|
||||
|
||||
return call_user_func(array($classname, 'create'), $config, $log);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user