Webmozart\Console\Process\ProcessLauncher::launchProcess PHP Method

launchProcess() public method

Launches a process in the foreground.
public launchProcess ( string $command, array $arguments = [], boolean $killable = true ) : integer
$command string The command to execute.
$arguments array Arguments to be quoted and inserted into the command. Each key "key" in the array should correspond to a placeholder "%key%" in the command.
$killable boolean Whether the process can be killed by the user.
return integer The exit status of the process.
    public function launchProcess($command, array $arguments = array(), $killable = true)
    {
        $this->installSignalHandlers($killable);
        $exitCode = $this->run($command, $arguments);
        $this->restoreSignalHandlers($killable);
        return $exitCode;
    }

Usage Example

コード例 #1
0
 public function testLaunchWithError()
 {
     if (!$this->php) {
         $this->markTestSkipped('The "bash" binary is not available.');
         return;
     }
     if (!function_exists('proc_open')) {
         $this->markTestSkipped('The "proc_open" function is not available.');
         return;
     }
     $status = $this->launcher->launchProcess($this->php . ' -r %command%', array('command' => 'exit(123);'));
     $this->assertSame(123, $status);
 }
All Usage Examples Of Webmozart\Console\Process\ProcessLauncher::launchProcess