Files
handbrake-cluster-webui/lib/HandBrakeCluster/Worker/PluginFactory.class.php
Ben Roberts 40fa00c034 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.
2010-08-22 23:05:33 +01:00

27 lines
724 B
PHP

<?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'));
}
}
?>