\Symfony\Component\ProcessPhpProcess

PhpProcess runs a PHP script in an independent process.

$p = new PhpProcess('<?php echo "foo"; ?>'); $p->run(); print $p->getOutput()."\n";

Summary

Methods
Properties
Constants
__construct()
setPhpBinary()
start()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string  $script, string|null  $cwd = null, array|null  $env = null, integer  $timeout = 60) 

Parameters

string $script

The PHP script to run (as a string)

string|null $cwd

The working directory or null to use the working dir of the current PHP process

array|null $env

The environment variables or null to use the same environment as the current PHP process

integer $timeout

The timeout in seconds

setPhpBinary()

setPhpBinary(  $php) 

Sets the path to the PHP binary to use.

Parameters

$php

start()

start(callable  $callback = null, array  $env = array()) 

{@inheritdoc}

Parameters

callable $callback
array $env