Toolkit

ConfigurationCommand extends BaseTask
in package
implements BuilderAwareInterface uses BuilderAwareTrait

Execute the tasks from a Configuration command.

Table of Contents

Interfaces

BuilderAwareInterface

Properties

$availableTasks  : array<string|int, mixed>
Contains the available tasks and configuration.
$tasks  : array<string|int, mixed>
An array with tasks to execute.

Methods

__construct()  : mixed
Constructs a new Process task.
getTasks()  : array<string|int, mixed>
Return the current tasks.
run()  : mixed
Run the command tasks.
taskExecute()  : mixed
Execute single task.
paramDefaultValue()  : string|bool|mixed
The default parameter values, return all or given parameter default value.
prepareOutput()  : mixed
Prepares the Output of a taskExec.
throwInvalidTaskException()  : mixed
Report missing parameter, this stops the execution.
throwParamException()  : mixed
Report missing parameter, this stops the execution.
validateAndEnsureParameters()  : mixed
Validate and ensure the parameter are met.

Properties

$availableTasks

Contains the available tasks and configuration.

protected array<string|int, mixed> $availableTasks = ['mkdir' => ['required' => 'dir', 'defaults' => 'mode'], 'touch' => ['required' => 'file', 'defaults' => ['time', 'atime']], 'copy' => ['required' => ['from', 'to'], 'defaults' => 'force'], 'copy-dir' => ['required' => ['from', 'to']], 'rename' => ['required' => ['from', 'to'], 'defaults' => 'force'], 'chmod' => ['required' => ['file', 'permissions'], 'defaults' => ['umask', 'recursive']], 'chgrp' => ['required' => ['file', 'group'], 'defaults' => 'recursive'], 'chown' => ['required' => ['file', 'user'], 'defaults' => 'recursive'], 'remove' => ['required' => 'file'], 'symlink' => ['required' => ['from', 'to']], 'mirror' => ['required' => ['from', 'to']], 'process' => ['required' => ['source'], 'defaults' => 'destination'], 'append' => ['required' => ['file', 'text']], 'run' => ['required' => 'command'], 'exec' => ['required' => 'command'], 'drush' => ['required' => 'command'], 'replace-block' => ['required' => ['filename', 'start', 'end'], 'defaults' => ['content', 'excludeStartEnd']]]

Each task defines all the needed parameters to execute, the required to ensure they are present, and the defaults to ensure they have the default value.

Methods

__construct()

Constructs a new Process task.

public __construct(array<string|int, mixed> $tasks) : mixed
Parameters
$tasks : array<string|int, mixed>

The Command Tasks.

getTasks()

Return the current tasks.

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

The tasks.

taskExecute()

Execute single task.

protected taskExecute(mixed $task) : mixed
Parameters
$task : mixed

The task to execute.

Tags
throws
TaskException
SuppressWarnings

(PHPMD.CyclomaticComplexity)

SuppressWarnings

(PHPMD.NPathComplexity)

SuppressWarnings

(PHPMD.ExcessiveMethodLength)

paramDefaultValue()

The default parameter values, return all or given parameter default value.

private paramDefaultValue(string $key) : string|bool|mixed
Parameters
$key : string

The parameter name.

Return values
string|bool|mixed

The default value for given name.

prepareOutput()

Prepares the Output of a taskExec.

private prepareOutput(mixed $taskExec) : mixed
Parameters
$taskExec : mixed

The task exec being executed.

throwInvalidTaskException()

Report missing parameter, this stops the execution.

private throwInvalidTaskException(string $task) : mixed
Parameters
$task : string

The task being checked.

Tags
throws
TaskException

throwParamException()

Report missing parameter, this stops the execution.

private throwParamException(string $param, string $task) : mixed
Parameters
$param : string

The missing parameter.

$task : string

The task being checked.

Tags
throws
TaskException

validateAndEnsureParameters()

Validate and ensure the parameter are met.

private validateAndEnsureParameters(mixed &$task) : mixed
Parameters
$task : mixed

The task being executed.

Tags
see
ConfigurationCommand::availableTasks
see
ConfigurationCommand::paramDefaultValue()
throws
TaskException

        
On this page

Search results