InvokedProcess
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
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new invoked process instance.
Get the process ID if the process is still running.
Get the command line for the process.
Send a signal to the process.
Stop the process if it is still running.
Determine if the process is still running.
Get the standard output for the process.
Get the error output for the process.
Get the latest standard output for the process.
Get the latest error output for the process.
Ensure that the process has not timed out.
Wait for the process to finish.
Wait until the given callback returns true.
Details
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.
ProcessResult
wait(callable|null $output = null)
Wait for the process to finish.
ProcessResult
waitUntil(callable|null $output = null)
Wait until the given callback returns true.
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.