-
Notifications
You must be signed in to change notification settings - Fork 3
Writing Custom Tasks
enygma edited this page Dec 19, 2011
·
8 revisions
Usher tasks were designed to be easy to use and create. Tasks follow this basic structure:
<?php
namespace Usher\Lib\Task;
class SampleTask extends \Usher\Lib\Task
{
public function execute()
{
$param1 = $this->getOption('param1');
$projectParam1 = $this->getProjectOption('projectParam1');
}
}
?>
In the above example, we're setting up a sample task (Sample.php) with an execute() method. This is the default method run as a part of the build process. You can pull information from the current tasks's config with "getOption" and settings from the overall project config with "getProjectOption".