Heratio Framework API Reference

AhgTask extends sfBaseTask
in package

AbstractYes

Base task class for AHG CLI commands.

Extends sfBaseTask with framework bootstrap and modern helpers. Plugin task classes should extend this instead of sfBaseTask directly.

Usage: class myCustomTask extends AhgTask { protected function configure() { $this->addArguments([...]); $this->namespace = 'my'; $this->name = 'custom'; }

  protected function execute($arguments = [], $options = []) {
      $this->initFramework();
      // Framework is now bootstrapped
  }

}

Table of Contents

Methods

__construct()  : mixed
execute()  : mixed
Override in task subclasses.
getArguments()  : array<string|int, mixed>
getBriefDescription()  : string
getDetailedDescription()  : string
getFullName()  : string
getName()  : string
getNamespace()  : string
getOptions()  : array<string|int, mixed>
run()  : int
Run the task with parsed arguments and options.

Methods

__construct()

public __construct([mixed $dispatcher = null ][, mixed $formatter = null ]) : mixed
Parameters
$dispatcher : mixed = null
$formatter : mixed = null

execute()

Override in task subclasses.

public abstract execute([mixed $arguments = [] ][, mixed $options = [] ]) : mixed
Parameters
$arguments : mixed = []
$options : mixed = []

getArguments()

public getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBriefDescription()

public getBriefDescription() : string
Return values
string

getDetailedDescription()

public getDetailedDescription() : string
Return values
string

getFullName()

public getFullName() : string
Return values
string

getName()

public getName() : string
Return values
string

getNamespace()

public getNamespace() : string
Return values
string

getOptions()

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

run()

Run the task with parsed arguments and options.

public run([array<string|int, mixed> $arguments = [] ][, array<string|int, mixed> $options = [] ]) : int

Called by TaskRunner after argument parsing.

Parameters
$arguments : array<string|int, mixed> = []
$options : array<string|int, mixed> = []
Return values
int

        
On this page

Search results