class InvokedProcess implements InvokedProcess (View source)

Traits

Properties

static protected array $macros

The registered string macros.

from  Macroable
protected Process $process

The underlying process instance.

Methods

static void
macro(string $name, object|callable $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Checks if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

__construct(Process $process)

Create a new invoked process instance.

int|null
id()

Get the process ID if the process is still running.

string
command()

Get the command line for the process.

$this
signal(int $signal)

Send a signal to the process.

int|null
stop(float $timeout = 10, int|null $signal = null)

Stop the process if it is still running.

bool
running()

Determine if the process is still running.

string
output()

Get the standard output for the process.

string
errorOutput()

Get the error output for the process.

string
latestOutput()

Get the latest standard output for the process.

string
latestErrorOutput()

Get the latest error output for the process.

void
ensureNotTimedOut()

Ensure that the process has not timed out.

wait(callable|null $output = null)

Wait for the process to finish.

waitUntil(callable|null $output = null)

Wait until the given callback returns true.

Details

static void macro(string $name, object|callable $macro)

Register a custom macro.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static void flushMacros()

Flush the existing macros.

Return Value

void

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

__construct(Process $process)

Create a new invoked process instance.

Parameters

Process $process

int|null id()

Get the process ID if the process is still running.

Return Value

int|null

string command()

Get the command line for the process.

Return Value

string

$this signal(int $signal)

Send a signal to the process.

Parameters

int $signal

Return Value

$this

int|null stop(float $timeout = 10, int|null $signal = null)

Stop the process if it is still running.

Parameters

float $timeout
int|null $signal

Return Value

int|null

bool running()

Determine if the process is still running.

Return Value

bool

string output()

Get the standard output for the process.

Return Value

string

string errorOutput()

Get the error output for the process.

Return Value

string

string latestOutput()

Get the latest standard output for the process.

Return Value

string

string latestErrorOutput()

Get the latest error output for the process.

Return Value

string

void ensureNotTimedOut()

Ensure that the process has not timed out.

Return Value

void

Exceptions

ProcessTimedOutException

ProcessResult wait(callable|null $output = null)

Wait for the process to finish.

Parameters

callable|null $output

Return Value

ProcessResult

Exceptions

ProcessTimedOutException

ProcessResult waitUntil(callable|null $output = null)

Wait until the given callback returns true.

Parameters

callable|null $output

Return Value

ProcessResult

Exceptions

ProcessTimedOutException

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.