1 | <?php |
||
17 | abstract class BuildTask |
||
18 | { |
||
19 | use Injectable; |
||
20 | use Configurable; |
||
21 | use Extensible; |
||
22 | |||
23 | public function __construct() |
||
27 | |||
28 | /** |
||
29 | * Set a custom url segment (to follow dev/tasks/) |
||
30 | * |
||
31 | * @config |
||
32 | * @var string |
||
33 | */ |
||
34 | private static $segment = null; |
||
35 | |||
36 | /** |
||
37 | * @var bool $enabled If set to FALSE, keep it from showing in the list |
||
38 | * and from being executable through URL or CLI. |
||
39 | */ |
||
40 | protected $enabled = true; |
||
41 | |||
42 | /** |
||
43 | * @var string $title Shown in the overview on the {@link TaskRunner} |
||
44 | * HTML or CLI interface. Should be short and concise, no HTML allowed. |
||
45 | */ |
||
46 | protected $title; |
||
47 | |||
48 | /** |
||
49 | * @var string $description Describe the implications the task has, |
||
50 | * and the changes it makes. Accepts HTML formatting. |
||
51 | */ |
||
52 | protected $description = 'No description available'; |
||
53 | |||
54 | /** |
||
55 | * Implement this method in the task subclass to |
||
56 | * execute via the TaskRunner |
||
57 | * |
||
58 | * @param HTTPRequest $request |
||
59 | * @return |
||
60 | */ |
||
61 | abstract public function run($request); |
||
62 | |||
63 | /** |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function isEnabled() |
||
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getTitle() |
||
78 | |||
79 | /** |
||
80 | * @return string HTML formatted description |
||
81 | */ |
||
82 | public function getDescription() |
||
86 | } |
||
87 |