class Process

System Process

Methods

static object
create(array|string $command, array $env = null, string $input = null, integer $timeout = 60, array|null $options = null)

Create process

static mixed
run(string|array $command, array $env = [], boolean $inheritEnv = true)

Run console command

static mixed
start(array $command, callable $callback = null, array|null $env = null)

Run console command

static void
setTitle(string $title)

Set process title

static mixed
startBackground(array $command, callable|null $callback = null, array $env = [])

Run console command in backgorund

static string
getCurrentUser()

Get current script user

static string
findPhp()

Get php executable

static bool
stop(string|int $pid)

Stop (kill) process

static bool
isRunning(integer $pid)

Reurn true if process is running (Linux only)

static bool
verifyProcess(int $pid)

Return false if process not exist

static string
getCommand(integer $pid)

Get process command

static mixed
getCurrentPid()

Get curret process pid

static mixed
runComposerCommand(string $command, bool $async = false, bool $realTimeOutput = false)

Run composer command

Details

at line 33
static object create(array|string $command, array $env = null, string $input = null, integer $timeout = 60, array|null $options = null)

Create process

Parameters

array|string $command
array $env
string $input
integer $timeout
array|null $options

Return Value

object

at line 49
static mixed run(string|array $command, array $env = [], boolean $inheritEnv = true)

Run console command

Parameters

string|array $command
array $env
boolean $inheritEnv

Return Value

mixed

at line 67
static mixed start(array $command, callable $callback = null, array|null $env = null)

Run console command

Parameters

array $command
callable $callback
array|null $env

Return Value

mixed

at line 81
static void setTitle(string $title)

Set process title

Parameters

string $title

Return Value

void

at line 94
static mixed startBackground(array $command, callable|null $callback = null, array $env = [])

Run console command in backgorund

Parameters

array $command
callable|null $callback
array $env

Return Value

mixed

at line 108
static string getCurrentUser()

Get current script user

Return Value

string

at line 118
static string findPhp()

Get php executable

Return Value

string

at line 129
static bool stop(string|int $pid)

Stop (kill) process

Parameters

string|int $pid

Return Value

bool

at line 151
static bool isRunning(integer $pid)

Reurn true if process is running (Linux only)

Parameters

integer $pid

Return Value

bool

at line 175
static bool verifyProcess(int $pid)

Return false if process not exist

Parameters

int $pid

Return Value

bool

at line 186
static string getCommand(integer $pid)

Get process command

Parameters

integer $pid

Return Value

string

at line 198
static mixed getCurrentPid()

Get curret process pid

Return Value

mixed

at line 211
static mixed runComposerCommand(string $command, bool $async = false, bool $realTimeOutput = false)

Run composer command

Parameters

string $command
bool $async
bool $realTimeOutput

Return Value

mixed