Update worker code to the point that it can run.
Added plugin architecture for Worker functions, to support multiple ripping engines. Update worker script to use the new code. Update Logger to output messages to console when running under the worker script.
This commit is contained in:
27
lib/HandBrakeCluster/Worker/PluginFactory.class.php
Normal file
27
lib/HandBrakeCluster/Worker/PluginFactory.class.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class HandBrakeCluster_Worker_PluginFactory extends HandBrakeCluster_PluginFactory {
|
||||
|
||||
const PLUGIN_DIR = 'HandBrakeCluster/Worker/Plugin/';
|
||||
const PREFIX = 'HandBrakeCluster_Worker_Plugin_';
|
||||
|
||||
public static function init() {
|
||||
|
||||
}
|
||||
|
||||
public static function scan() {
|
||||
$candidatePlugins = parent::findPlugins(self::PLUGIN_DIR);
|
||||
|
||||
parent::loadPlugins($candidatePlugins, self::PREFIX);
|
||||
}
|
||||
|
||||
public static function getPluginWorkerFunctions($plugin) {
|
||||
if ( ! isset(parent::$validPlugins[$plugin])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return call_user_func(array(parent::$validPlugins[$plugin], 'workerFunctions'));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user