mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add doc blocks for the $request given to BuildTasks
Allows BuildTask developers to know what the $request is, and outline BuildTask instances.
This commit is contained in:
parent
b56a8075a3
commit
d7db913824
@ -33,9 +33,14 @@ abstract class BuildTask extends Object {
|
||||
/**
|
||||
* Implement this method in the task subclass to
|
||||
* execute via the TaskRunner
|
||||
*
|
||||
* @param SS_HTTPRequest $request
|
||||
*/
|
||||
abstract public function run($request);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isEnabled() {
|
||||
return $this->enabled;
|
||||
}
|
||||
@ -55,5 +60,3 @@ abstract class BuildTask extends Object {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,6 +59,10 @@ class TaskRunner extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a BuildTask
|
||||
* @param SS_HTTPRequest $request
|
||||
*/
|
||||
public function runTask($request) {
|
||||
$name = $request->param('TaskName');
|
||||
$tasks = $this->getTasks();
|
||||
@ -73,7 +77,7 @@ class TaskRunner extends Controller {
|
||||
|
||||
foreach ($tasks as $task) {
|
||||
if ($task['segment'] == $name) {
|
||||
$inst = Injector::inst()->create($task['class']);
|
||||
$inst = Injector::inst()->create($task['class']); /** @var BuildTask $inst */
|
||||
$title(sprintf('Running Task %s', $inst->getTitle()));
|
||||
|
||||
if (!$inst->isEnabled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user