'index',
'$TaskName' => 'runTask'
);
function index() {
$tasks = ClassInfo::subclassesFor('BuildTask');
echo "
";
foreach($tasks as $task) {
echo "- $task
";
}
echo "
";
}
function runTask($request) {
$TaskName = $request->param('TaskName');
if (class_exists($TaskName) && is_subclass_of($TaskName, 'BuildTask')) {
if(Director::is_cli()) echo "Running task '$TaskName'...\n\n";
else echo "Running task '$TaskName'...
\n";
$task = new $TaskName();
if (!$task->isDisabled()) $task->run($request);
} else {
echo "Build task '$TaskName' not found.";
}
}
}
?>