\App\CoreModule\ModelsCommandManager

Tool for executing commands

Summary

Methods
Properties
Constants
__construct()
commandExist()
run()
runAsync()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(  sudo, \App\CoreModule\Models\CommandStack  stack) : 

Constructor

Parameters

sudo

Is sudo required?

\App\CoreModule\Models\CommandStack stack

Command stack

Returns

commandExist()

commandExist(  cmd) : 

Checks the existence of a command

Parameters

cmd

Command

Returns

Is the command exists?

run()

run(  command,   needSudo = false) : \App\CoreModule\Models\ICommand

Executes shell command and returns output

Parameters

command

Command to execute

needSudo

Does the command need sudo?

Returns

\App\CoreModule\Models\ICommand —

Command entity

runAsync()

runAsync(  callback,   command,   needSudo = false,   timeout = 36000) : 

Executes the command asynchronously

Parameters

callback

Callback to run whenever there is some output available on STDOUT or STDERR

command

Command to execute

needSudo

Does the command need sudo?

timeout

Command's timeout

Returns