1 <?php
2
3 /**
4 * Interface for a generic build task. Does not support dependencies. This will simply
5 * run a chunk of code when called.
6 *
7 * To disable the task (in the case of potentially destructive updates or deletes), declare
8 * the $Disabled property on the subclass.
9 *
10 * @todo move from sapphire/testing to sapphire/dev or sapphire/development?
11 * @package sapphire
12 * @subpackage dev
13 */
14 abstract class BuildTask extends Object {
15
16 /**
17 * @var bool $enabled If set to FALSE, keep it from showing in the list
18 * and from being executable through URL or CLI.
19 */
20 protected $enabled = true;
21
22 /**
23 * @var string $title Shown in the overview on the {@link TaskRunner}
24 * HTML or CLI interface. Should be short and concise, no HTML allowed.
25 */
26 protected $title;
27
28 /**
29 * @var string $description Describe the implications the task has,
30 * and the changes it makes. Accepts HTML formatting.
31 */
32 protected $description = 'No description available';
33
34 /**
35 * Implement this method in the task subclass to
36 * execute via the TaskRunner
37 */
38 abstract function run($request);
39
40 public function isEnabled() {
41 return $this->enabled;
42 }
43
44 /**
45 * @return string
46 */
47 public function getTitle() {
48 return ($this->title) ? $this->title : $this->class;
49 }
50
51 /**
52 * @return string HTML formatted description
53 */
54 public function getDescription() {
55 return $this->description;
56 }
57
58 }
59
60 ?>
61