Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Process.php

function Process::run

Same name in this branch
  1. 11.1.x vendor/php-tuf/composer-stager/src/Internal/Process/Service/Process.php \PhpTuf\ComposerStager\Internal\Process\Service\Process::run()

Runs the process.

The callback receives the type of output (out or err) and some bytes from the output in real-time. It allows to have feedback from the independent process during execution.

The STDOUT and STDERR are also available after the process is finished via the getOutput() and getErrorOutput() methods.

@final

Parameters

callable|null $callback A PHP callback to run whenever there is some: output available on STDOUT or STDERR

Return value

int The exit status code

Throws

ProcessStartFailedException When process can't be launched

RuntimeException When process is already running

ProcessTimedOutException When process timed out

ProcessSignaledException When process stopped after receiving signal

LogicException In case a callback is provided and output has been disabled

1 call to Process::run()
Process::mustRun in vendor/symfony/process/Process.php
Runs the process.

File

vendor/symfony/process/Process.php, line 248

Class

Process
Process is a thin wrapper around proc_* functions to easily start independent PHP processes.

Namespace

Symfony\Component\Process

Code

public function run(?callable $callback = null, array $env = []) : int {
    $this->start($callback, $env);
    return $this->wait();
}
RSS feed
Powered by Drupal