Satis
extends Base
in package
Components_Release_Task_Satis:: Rebuild a satis repo
Copyright 2011-2019 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
- $_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, mixed>
- Ask for the \Horde_Http_Client dependency
- 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 if we are setup
- run() : void
- 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?
- _options() : array<string|int, mixed>
- Ensure default and required options
- 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
$_deps
protected
mixed
$_deps
= []
$_name
The task name.
protected
string
$_name
$_notes
protected
Notes
$_notes
$_output
protected
Output
$_output
$_tasks
protected
Tasks
$_tasks
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 the \Horde_Http_Client dependency
public
askDependencies() : array<string|int, mixed>
Return values
array<string|int, mixed> —The list of dependencies requested
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 if we are setup
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) : void
Checkout the wanted branch Supports pretend mode
Parameters
- $options : array<string|int, mixed>
-
Additional options by reference.
Return values
void —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.
_options()
Ensure default and required options
protected
_options(array<string|int, mixed> $options) : array<string|int, mixed>
- satis_bin: path to satis cli defaults to "which"
- satis_json: path to satis json file defaults to ''
- satis_outdir: path where satis should write the repository default ''
- satis_push: Try to commit and push the generated content as git repo? Defaults to false
Parameters
- $options : array<string|int, mixed>
-
Additional options.
Return values
array<string|int, mixed> —The processed options
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() : 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.