__construct() public method

Constructor.
public __construct ( string $script, string $cwd = null, array $env = [], integer $timeout = 60, array $options = [] )
$script string The PHP script to run (as a string)
$cwd string The working directory
$env array The environment variables
$timeout integer The timeout in seconds
$options array An array of options for proc_open
Example #1
0
 /**
  * Constructor.
  *
  * @param string $documentRoot The document root for the web server.
  *
  * @param string $addr The address hostname for the web server.
  *
  * @param int $port The port to open the web server on.
  */
 public function __construct($documentRoot = null, $addr = 'localhost', $port = 8080)
 {
     $this->executableFinder = new PhpExecutableFinder();
     $this->addr = $addr;
     $this->port = $port;
     $this->documentRoot = $documentRoot;
     parent::__construct('');
 }
Example #2
0
 /**
  * @param CommandLine        $script
  * @param ProcessEnvironment $processEnvironment
  * @param int|float|null     $timeout
  * @param string|null        $cwd
  */
 public function __construct(CommandLine $script, ProcessEnvironment $processEnvironment, $timeout = null, $cwd = null)
 {
     $this->processEnvironment = $processEnvironment;
     parent::__construct((string) $script, null, $this->processEnvironment->exportToEnvsArray());
     if (!$timeout) {
         $this->setTimeout($timeout);
         // compatibility to SF 2.2
         if (method_exists($this, 'setIdleTimeout')) {
             $this->setIdleTimeout($timeout);
         }
     }
 }