PluginProbe
ManageWP Worker / 4.9.25
ManageWP Worker v4.9.25
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / src / Symfony / Process / PhpProcess.php

PhpProcess.php in ManageWP Worker 4.9.25, at src/Symfony/Process/PhpProcess.php

68 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 /**
13 * PhpProcess runs a PHP script in an independent process.
14 *
15 * $p = new PhpProcess('<?php echo "foo"; ?>');
16 * $p->run();
17 * print $p->getOutput()."\n";
18 *
19 * @author Fabien Potencier <fabien@symfony.com>
20 *
21 * @api
22 */
23 class Symfony_Process_PhpProcess extends Symfony_Process_Process
24 {
25 /**
26 * Constructor.
27 *
28 * @param string $script The PHP script to run (as a string)
29 * @param string $cwd The working directory
30 * @param array $env The environment variables
31 * @param int $timeout The timeout in seconds
32 * @param array $options An array of options for proc_open
33 *
34 * @api
35 */
36 public function __construct($script, $cwd = null, array $env = array(), $timeout = 60, array $options = array())
37 {
38 $executableFinder = new Symfony_Process_PhpExecutableFinder();
39 if (false === $php = $executableFinder->find()) {
40 $php = null;
41 }
42
43 parent::__construct($php, $cwd, $env, $script, $timeout, $options);
44 }
45
46 /**
47 * Sets the path to the PHP binary to use.
48 *
49 * @api
50 */
51 public function setPhpBinary($php)
52 {
53 $this->setCommandLine($php);
54 }
55
56 /**
57 * {@inheritdoc}
58 */
59 public function start($callback = null)
60 {
61 if (null === $this->getCommandLine()) {
62 throw new Symfony_Process_Exception_RuntimeException('Unable to find the PHP executable.');
63 }
64
65 parent::start($callback);
66 }
67 }
68