Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp.../vendor/symfony/process
File: PhpProcess.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* This file is part of the Symfony package.
[3] Fix | Delete
*
[4] Fix | Delete
* (c) Fabien Potencier <fabien@symfony.com>
[5] Fix | Delete
*
[6] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[7] Fix | Delete
* file that was distributed with this source code.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
namespace Symfony\Component\Process;
[11] Fix | Delete
[12] Fix | Delete
use Symfony\Component\Process\Exception\RuntimeException;
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* PhpProcess runs a PHP script in an independent process.
[16] Fix | Delete
*
[17] Fix | Delete
* $p = new PhpProcess('<?php echo "foo"; ?>');
[18] Fix | Delete
* $p->run();
[19] Fix | Delete
* print $p->getOutput()."\n";
[20] Fix | Delete
*
[21] Fix | Delete
* @author Fabien Potencier <fabien@symfony.com>
[22] Fix | Delete
*/
[23] Fix | Delete
class PhpProcess extends Process
[24] Fix | Delete
{
[25] Fix | Delete
/**
[26] Fix | Delete
* @param string $script The PHP script to run (as a string)
[27] Fix | Delete
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
[28] Fix | Delete
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
[29] Fix | Delete
* @param int $timeout The timeout in seconds
[30] Fix | Delete
* @param array $options An array of options for proc_open
[31] Fix | Delete
*/
[32] Fix | Delete
public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = null)
[33] Fix | Delete
{
[34] Fix | Delete
$executableFinder = new PhpExecutableFinder();
[35] Fix | Delete
if (false === $php = $executableFinder->find(false)) {
[36] Fix | Delete
$php = null;
[37] Fix | Delete
} else {
[38] Fix | Delete
$php = array_merge([$php], $executableFinder->findArguments());
[39] Fix | Delete
}
[40] Fix | Delete
if ('phpdbg' === \PHP_SAPI) {
[41] Fix | Delete
$file = tempnam(sys_get_temp_dir(), 'dbg');
[42] Fix | Delete
file_put_contents($file, $script);
[43] Fix | Delete
register_shutdown_function('unlink', $file);
[44] Fix | Delete
$php[] = $file;
[45] Fix | Delete
$script = null;
[46] Fix | Delete
}
[47] Fix | Delete
if (null !== $options) {
[48] Fix | Delete
@trigger_error(sprintf('The $options parameter of the %s constructor is deprecated since Symfony 3.3 and will be removed in 4.0.', __CLASS__), \E_USER_DEPRECATED);
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
parent::__construct($php, $cwd, $env, $script, $timeout, $options);
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Sets the path to the PHP binary to use.
[56] Fix | Delete
*/
[57] Fix | Delete
public function setPhpBinary($php)
[58] Fix | Delete
{
[59] Fix | Delete
$this->setCommandLine($php);
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* {@inheritdoc}
[64] Fix | Delete
*/
[65] Fix | Delete
public function start(callable $callback = null/*, array $env = []*/)
[66] Fix | Delete
{
[67] Fix | Delete
if (null === $this->getCommandLine()) {
[68] Fix | Delete
throw new RuntimeException('Unable to find the PHP executable.');
[69] Fix | Delete
}
[70] Fix | Delete
$env = 1 < \func_num_args() ? func_get_arg(1) : null;
[71] Fix | Delete
[72] Fix | Delete
parent::start($callback, $env);
[73] Fix | Delete
}
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function