Documentation

Base
in package
implements TaskInterface Uses SystemCall, Dependencies

Components_Release_Task_Base:: provides core functionality for release tasks.

Copyright 2011-2020 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
category

Horde

author

Gunnar Wrobel wrobel@pardus.de

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Interfaces, Classes, Traits and Enums

TaskInterface
Common interface for tasks used in Release, Qc and Pipeline

Table of Contents

$_component  : Source
The component that should be released
$_deps  : mixed
$_name  : string
The task name.
$_notes  : Notes
$_output  : Output
$_tasks  : Tasks
__construct()  : mixed
Constructor.
askDependencies()  : array<string|int, string>
Ask for dependencies.
getDependency()  : object|null
Retrieve a dependency
getName()  : string
Get the name of this task.
postValidate()  : array<string|int, mixed>
Validate the postconditions required for this release task to have succeeded.
pretend()  : bool
preValidate()  : array<string|int, mixed>
Validate the preconditions required for this release task.
run()  : mixed
Run the task.
setComponent()  : void
Set the component this task should act upon.
setDependencies()  : void
Receive dependencies
setName()  : void
Set the name of this task.
skip()  : bool
Can the task be skipped?
exec()  : SystemCallResult
Run a system call and capture output.
execInDirectory()  : SystemCallResult
Run a system call in a given dir and capture output.
getComponent()  : Source
Get the component this task should act upon.
getNotes()  : Notes
Get the release notes.
getOutput()  : Output
Get the output handler.
getTasks()  : Tasks
Get the tasks handler.
system()  : string
Run a system call.
systemInDirectory()  : string
Run a system call.

Properties

$_component

The component that should be released

protected Source $_component

$_name

The task name.

protected string $_name

Methods

__construct()

Constructor.

public __construct(Tasks $_tasks, Notes $_notes, Output $_output) : mixed
Parameters
$_tasks : Tasks

The task handler.

$_notes : Notes

The release notes.

$_output : Output

Accepts output.

Return values
mixed

askDependencies()

Ask for dependencies.

public askDependencies() : array<string|int, string>

Declares which helpers or other utilities the task wants to have

The request format is an associative array. The key will be reused by the answer from outside, the value is a string identifying the base class or interface of the dependency.

As long as the injector knows how to provide the dependencies, there is no need for individual factories or annotations per task.

Dependencies unfulfilled should be returned as null values for the keys.

The task should decide itself if this is fatal or optional

Return values
array<string|int, string>

The dictionary of dependencies.

getDependency()

Retrieve a dependency

public getDependency(string $key) : object|null

It must have been registered by askDependencies and the calling code should provide it or null

Parameters
$key : string

The dependency to get.

Return values
object|null

The dependency or null

getName()

Get the name of this task.

public getName() : string
Return values
string

The task name.

postValidate()

Validate the postconditions required for this release task to have succeeded.

public postValidate(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
array<string|int, mixed>

An empty array if all postconditions are met and a list of error messages otherwise.

pretend()

public pretend() : bool
Return values
bool

preValidate()

Validate the preconditions required for this release task.

public preValidate(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
array<string|int, mixed>

An empty array if all preconditions are met and a list of error messages otherwise.

run()

Run the task.

public run(array<string|int, mixed> &$options) : mixed
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
mixed

setComponent()

Set the component this task should act upon.

public setComponent(Source $component) : void
Parameters
$component : Source

The component to be released.

Return values
void

setDependencies()

Receive dependencies

public setDependencies(array<string|int, mixed> $dependencies) : void

The format contains the same keys ad askDependencies, but the values are instances of the requested types or null if unfulfilled.

Parameters
$dependencies : array<string|int, mixed>

The provided dependencies.

Return values
void

setName()

Set the name of this task.

public setName(string $name) : void
Parameters
$name : string

The task name.

Return values
void

skip()

Can the task be skipped?

public skip(array<string|int, mixed> $options) : bool
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
bool

True if it can be skipped.

execInDirectory()

Run a system call in a given dir and capture output.

protected execInDirectory(string $call, string $target_dir) : SystemCallResult
Parameters
$call : string

The system call to execute.

$target_dir : string

Run the command in the provided target path.

Return values
SystemCallResult

The command output.

getComponent()

Get the component this task should act upon.

protected getComponent() : Source
Return values
Source

The component to be released.

getNotes()

Get the release notes.

protected getNotes() : Notes
Return values
Notes

The release notes.

getOutput()

Get the output handler.

protected getOutput() : Output
Return values
Output

The output handler.

getTasks()

Get the tasks handler.

protected getTasks() : Tasks
Return values
Tasks

The release tasks handler.

system()

Run a system call.

protected system(string $call) : string
Parameters
$call : string

The system call to execute.

Return values
string

The command output.

systemInDirectory()

Run a system call.

protected systemInDirectory(string $call, string $target_dir) : string
Parameters
$call : string

The system call to execute.

$target_dir : string

Run the command in the provided target path.

Return values
string

The command output.

Search results