Base
in package
Uses
SystemCall
Components_Qc_Task_Base:: provides core functionality for qc 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
Table of Contents
- $_config : Config
- $_component : Component|null
- The component that should be checked
- $_name : string|null
- The task name.
- $_output : Output
- $_tasks : Tasks
- __construct() : mixed
- Constructor.
- getName() : string
- Get the name of this task.
- run() : int
- Run the task.
- setComponent() : void
- Set the component this task should act upon.
- setName() : void
- Set the name of this task.
- validate() : array<string|int, mixed>
- Validate the preconditions required for this release task.
- exec() : SystemCallResult
- Run a system call and capture output.
- execInDirectory() : SystemCallResult
- Run a system call in a given dir and capture output.
- getComponent() : Component
- Get the component this task should act upon.
- 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
$_config
protected
Config
$_config
$_component
The component that should be checked
private
Component|null
$_component
= null
$_name
The task name.
private
string|null
$_name
= null
$_output read-only
private
Output
$_output
$_tasks read-only
private
Tasks
$_tasks
Methods
__construct()
Constructor.
public
__construct(Config $_config, Tasks $_tasks, Output $_output) : mixed
Parameters
- $_config : Config
-
The configuration for the current job.
- $_tasks : Tasks
-
The task handler.
- $_output : Output
-
Accepts output.
Return values
mixed —getName()
Get the name of this task.
public
getName() : string
Return values
string —The task name.
run()
Run the task.
public
run([array<string|int, mixed> &$options = [] ]) : int
Parameters
- $options : array<string|int, mixed> = []
-
Additional options.
Return values
int —Number of errors.
setComponent()
Set the component this task should act upon.
public
setComponent(Component $component) : void
Parameters
- $component : Component
-
The component to be checked.
Return values
void —setName()
Set the name of this task.
public
setName(string $name) : void
Parameters
- $name : string
-
The task name.
Return values
void —validate()
Validate the preconditions required for this release task.
public
validate([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.
exec()
Run a system call and capture output.
protected
exec(string $call) : SystemCallResult
Parameters
- $call : string
-
The system call to execute.
Return values
SystemCallResult —The command output.
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() : Component
Return values
Component —The component to be checked.
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.