* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Process; use Symfony\Component\Process\Exception\LogicException; use Symfony\Component\Process\Exception\RuntimeException; /** * PhpProcess runs a PHP script in an independent process. * * $p = new PhpProcess(''); * $p->run(); * print $p->getOutput()."\n"; * * @author Fabien Potencier */ class PhpProcess extends Process { /** * @param string $script The PHP script to run (as a string) * @param string|null $cwd The working directory or null to use the working dir of the current PHP process * @param array|null $env The environment variables or null to use the same environment as the current PHP process * @param int $timeout The timeout in seconds * @param array|null $php Path to the PHP binary to use with any additional arguments */ public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) { if (null === $php) { $executableFinder = new PhpExecutableFinder(); $php = $executableFinder->find(false); $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); } if ('phpdbg' === \PHP_SAPI) { $file = tempnam(sys_get_temp_dir(), 'dbg'); file_put_contents($file, $script); register_shutdown_function('unlink', $file); $php[] = $file; $script = null; } parent::__construct($php, $cwd, $env, $script, $timeout); } /** * {@inheritdoc} */ public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) { throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); } /** * {@inheritdoc} */ public function start(callable $callback = null, array $env = []) { if (null === $this->getCommandLine()) { throw new RuntimeException('Unable to find the PHP executable.'); } parent::start($callback, $env); } } __halt_compiler();----SIGNATURE:----YNwN9oSwDtXVbBSp5Gix4EzZeFYBrjjAUcoLwk72LupkaWdM6kLu6G+wjFd8l752OLe6JX/F9h6MN8K/eyyru35YVYWm0CDLTS28c0EISsHfUeJObz4iGzL1JDVHE38F21zJc7Scwt8VNuBWZal3v1Tlt/2Adlf/NCbWl4K6Cvbz5JRbSfslXAg+vV560TCr4uRr4XKVTS1OSfq1KE4F6/26uJKXRz6wV8D6Xtcf7zaOZC9gtnPBG3AFk9wexcDOhk8qftFp3EYTzLZnTULOcMFLSVA8P5dUpL5e1HPmwubLRaSl9YIiAgzcYv78Soq2o9/gC514ZVIu2jFqWmGaUtk9cunQMuaFtGHUS0uFDkQtQzk/EcR00JmRgrgmrU9iD0VnAbjx17XSkS14TXRGW6s0G9gCaX5WdGqLimizoVNgk70LHAlvS3eYTedTbKeTXCP8cikNIs8ZLh5+L5ZMbIPVmkVsQc9W3/B627OWpZG+KcalF1YpnEYyAIYr/8XhTRZvFNsbQy1eCHAL+MFtzlGOREm1QR2TkmdzzRcWJ3QbqAHlAFRC2pZyNi+wqPTVhMtKAJ5PHL5RwdQ4sWIS9aEUZhVPsDCp+7jwhsi8C3H2HKBPf5sZamloXVT9aWKrX0w4qE6FXkiyPXBVhdpBYitkIK4iH4r2Dzj8AXiT1K8=----ATTACHMENT:----NTk2MjI2ODA5Mjc1OTEyNiA3NTk5NDMzMDIxNTYwNjQ0IDM2MDYzNzIzNzgyNzU0Mjc=