PHP Class Laravel\Envoy\TaskContainer

Afficher le fichier Open project: laravel/envoy Class Usage Examples

Protected Properties

Свойство Type Description
$after array All of the "after" callbacks.
$error array All of the "error" callbacks.
$finished array All of the "finished" callbacks.
$macroOptions array All of the options for each macro.
$macroStack array The stack of macro being rendered.
$macros array All of the registered macros.
$servers array All of the registered servers.
$sharedData array All of the shared data.
$taskOptions array All of the options for each task.
$taskStack array The stack of tasks being rendered.
$tasks array All of the evaluated tasks.

Méthodes publiques

Méthode Description
after ( Closure $callback ) : void Register an after-task callback.
endMacro ( ) : void Stop defining a macro.
endTask ( ) : void Stop defining a task.
error ( Closure $callback ) : void Register an error-task callback.
finished ( Closure $callback ) : void Register an finished-task callback.
getAfterCallbacks ( ) : array Get all of the after-task callbacks.
getErrorCallbacks ( ) : array Get all of the error-task callbacks.
getFinishedCallbacks ( ) : array Get all of the finished-task callbacks.
getFirstServer ( ) : string Get the first registered server IP address.
getMacro ( string $macro ) : array | null Get the given macro from the container.
getMacroOptions ( string $macro ) : array Get the macro options for the given macro.
getMacros ( ) : array Getter for macros.
getServer ( string $server ) : string | null Get the IP address for a server.
getTask ( string $task, array $macroOptions = [] ) : Task Get a Task instance by the given name.
getTaskOptions ( string $task ) : array Get the task options for the given task.
getTasks ( ) : array Getter for tasks.
hasOneServer ( ) : boolean Determine if the container only has one registered server.
import ( string $file, array $data = [] ) : void Import the given file into the container.
load ( string $__path, Compiler $__compiler, array $__data = [], boolean $__serversOnly = false ) : void Load the Envoy file into the container.
loadServers ( string $path, Compiler $compiler ) : void Silently load the Envoy file into the container.
servers ( array $servers ) : void Register the array of servers with the container.
share ( string $key, mixed $value ) : void Share the given piece of data across all tasks.
startMacro ( string $macro, array $options = [] ) : void Begin defining a macro.
startTask ( string $task, array $options = [] ) : void Begin defining a task.

Méthodes protégées

Méthode Description
getServers ( array $options ) : array Get the IP addresses of the servers specified on the options.
mergeDefaultOptions ( array $options ) : array Merge the option array over the default options.
replaceSubTasks ( ) : void Replace all of the sub tasks and trim leading spaces.
resolveImportPath ( string $file ) : string | boolean Resolve the import path for the given file.
trimSpaces ( string $value ) : string Remove the leading space from the lines of a value.
writeCompiledEnvoyFile ( Compiler $compiler, string $path, boolean $serversOnly ) : string Write the compiled Envoy file to disk.

Method Details

after() public méthode

Register an after-task callback.
public after ( Closure $callback ) : void
$callback Closure
Résultat void

endMacro() public méthode

Stop defining a macro.
public endMacro ( ) : void
Résultat void

endTask() public méthode

Stop defining a task.
public endTask ( ) : void
Résultat void

error() public méthode

Register an error-task callback.
public error ( Closure $callback ) : void
$callback Closure
Résultat void

finished() public méthode

Register an finished-task callback.
public finished ( Closure $callback ) : void
$callback Closure
Résultat void

getAfterCallbacks() public méthode

Get all of the after-task callbacks.
public getAfterCallbacks ( ) : array
Résultat array

getErrorCallbacks() public méthode

Get all of the error-task callbacks.
public getErrorCallbacks ( ) : array
Résultat array

getFinishedCallbacks() public méthode

Get all of the finished-task callbacks.
public getFinishedCallbacks ( ) : array
Résultat array

getFirstServer() public méthode

Get the first registered server IP address.
public getFirstServer ( ) : string
Résultat string

getMacro() public méthode

Get the given macro from the container.
public getMacro ( string $macro ) : array | null
$macro string
Résultat array | null

getMacroOptions() public méthode

Get the macro options for the given macro.
public getMacroOptions ( string $macro ) : array
$macro string
Résultat array

getMacros() public méthode

Getter for macros.
public getMacros ( ) : array
Résultat array

getServer() public méthode

Get the IP address for a server.
public getServer ( string $server ) : string | null
$server string
Résultat string | null

getServers() protected méthode

Get the IP addresses of the servers specified on the options.
protected getServers ( array $options ) : array
$options array
Résultat array

getTask() public méthode

Get a Task instance by the given name.
public getTask ( string $task, array $macroOptions = [] ) : Task
$task string
$macroOptions array
Résultat Task

getTaskOptions() public méthode

Get the task options for the given task.
public getTaskOptions ( string $task ) : array
$task string
Résultat array

getTasks() public méthode

Getter for tasks.
public getTasks ( ) : array
Résultat array

hasOneServer() public méthode

Determine if the container only has one registered server.
public hasOneServer ( ) : boolean
Résultat boolean

import() public méthode

Import the given file into the container.
public import ( string $file, array $data = [] ) : void
$file string
$data array
Résultat void

load() public méthode

Load the Envoy file into the container.
public load ( string $__path, Compiler $__compiler, array $__data = [], boolean $__serversOnly = false ) : void
$__path string
$__compiler Compiler
$__data array
$__serversOnly boolean
Résultat void

loadServers() public méthode

No data is needed.
public loadServers ( string $path, Compiler $compiler ) : void
$path string
$compiler Compiler
Résultat void

mergeDefaultOptions() protected méthode

Merge the option array over the default options.
protected mergeDefaultOptions ( array $options ) : array
$options array
Résultat array

replaceSubTasks() protected méthode

Replace all of the sub tasks and trim leading spaces.
protected replaceSubTasks ( ) : void
Résultat void

resolveImportPath() protected méthode

Resolve the import path for the given file.
protected resolveImportPath ( string $file ) : string | boolean
$file string
Résultat string | boolean

servers() public méthode

Register the array of servers with the container.
public servers ( array $servers ) : void
$servers array
Résultat void

share() public méthode

Share the given piece of data across all tasks.
public share ( string $key, mixed $value ) : void
$key string
$value mixed
Résultat void

startMacro() public méthode

Begin defining a macro.
public startMacro ( string $macro, array $options = [] ) : void
$macro string
$options array
Résultat void

startTask() public méthode

Begin defining a task.
public startTask ( string $task, array $options = [] ) : void
$task string
$options array
Résultat void

trimSpaces() protected méthode

Remove the leading space from the lines of a value.
protected trimSpaces ( string $value ) : string
$value string
Résultat string

writeCompiledEnvoyFile() protected méthode

Write the compiled Envoy file to disk.
protected writeCompiledEnvoyFile ( Compiler $compiler, string $path, boolean $serversOnly ) : string
$compiler Compiler
$path string
$serversOnly boolean
Résultat string

Property Details

$after protected_oe property

All of the "after" callbacks.
protected array $after
Résultat array

$error protected_oe property

All of the "error" callbacks.
protected array $error
Résultat array

$finished protected_oe property

All of the "finished" callbacks.
protected array $finished
Résultat array

$macroOptions protected_oe property

All of the options for each macro.
protected array $macroOptions
Résultat array

$macroStack protected_oe property

The stack of macro being rendered.
protected array $macroStack
Résultat array

$macros protected_oe property

All of the registered macros.
protected array $macros
Résultat array

$servers protected_oe property

All of the registered servers.
protected array $servers
Résultat array

$sharedData protected_oe property

All of the shared data.
protected array $sharedData
Résultat array

$taskOptions protected_oe property

All of the options for each task.
protected array $taskOptions
Résultat array

$taskStack protected_oe property

The stack of tasks being rendered.
protected array $taskStack
Résultat array

$tasks protected_oe property

All of the evaluated tasks.
protected array $tasks
Résultat array