Файл: vendor/symfony/process/Process.php
Строк: 2244
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SymfonyComponentProcess;
use SymfonyComponentProcessExceptionInvalidArgumentException;
use SymfonyComponentProcessExceptionLogicException;
use SymfonyComponentProcessExceptionProcessFailedException;
use SymfonyComponentProcessExceptionProcessSignaledException;
use SymfonyComponentProcessExceptionProcessStartFailedException;
use SymfonyComponentProcessExceptionProcessTimedOutException;
use SymfonyComponentProcessExceptionRuntimeException;
use SymfonyComponentProcessPipesUnixPipes;
use SymfonyComponentProcessPipesWindowsPipes;
/**
* Process is a thin wrapper around proc_* functions to easily
* start independent PHP processes.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Romain Neutron <imprec@gmail.com>
*
* @implements IteratorAggregate<string, string>
*/
class Process implements IteratorAggregate
{
public const ERR = 'err';
public const OUT = 'out';
public const STATUS_READY = 'ready';
public const STATUS_STARTED = 'started';
public const STATUS_TERMINATED = 'terminated';
public const STDIN = 0;
public const STDOUT = 1;
public const STDERR = 2;
// Timeout Precision in seconds.
public const TIMEOUT_PRECISION = 0.2;
public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking
public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory
public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating
public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating
/**
* Maximum number of UTF-16 code units allowed in the Windows environment block.
*
* The Win32 CreateProcess API encodes env vars as KEY=VALUE in UTF-16LE,
* terminated by an extra