silverstripe-framework/dev/BuildTask.php
Ingo Schommer 5b91ea9d0a ENHANCEMENT Improved TaskRunner and BuildTask metadata and styling
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64446 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 20:40:24 +00:00

56 lines
1.3 KiB
PHP

<?php
/**
* Interface for a generic build task. Does not support dependencies. This will simply
* run a chunk of code when called.
*
* To disable the task (in the case of potentially destructive updates or deletes), declare
* the $Disabled property on the subclass.
*
* @todo move from sapphire/testing to sapphire/dev or sapphire/development?
* @package sapphire
* @subpackage dev
*/
abstract class BuildTask extends Object {
/**
* @var bool $enabled If set to FALSE, keep it from showing in the list
* and from being executable through URL or CLI.
*/
protected $enabled = true;
/**
* @var string $title Shown in the overview on the {@link TaskRunner}
* HTML or CLI interface. Should be short and concise, no HTML allowed.
*/
protected $title;
/**
* @var string $description Describe the implications the task has,
* and the changes it makes. Accepts HTML formatting.
*/
protected $description = 'No description available';
abstract function run($request);
public function isEnabled() {
return $this->enabled;
}
/**
* @return string
*/
public function getTitle() {
return ($this->title) ? $this->title : $this->class;
}
/**
* @return string HTML formatted description
*/
public function getDescription() {
return $this->description;
}
}
?>