AbstractPipes.php
1 year ago
PipesInterface.php
1 year ago
UnixPipes.php
1 year ago
WindowsPipes.php
1 year ago
PipesInterface.php
55 lines
| 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 | namespace Symfony\Component\Process\Pipes; |
| 12 | |
| 13 | /** |
| 14 | * PipesInterface manages descriptors and pipes for the use of proc_open. |
| 15 | * |
| 16 | * @author Romain Neutron <imprec@gmail.com> |
| 17 | * |
| 18 | * @internal |
| 19 | */ |
| 20 | interface PipesInterface |
| 21 | { |
| 22 | public const CHUNK_SIZE = 16384; |
| 23 | /** |
| 24 | * Returns an array of descriptors for the use of proc_open. |
| 25 | */ |
| 26 | public function getDescriptors() : array; |
| 27 | /** |
| 28 | * Returns an array of filenames indexed by their related stream in case these pipes use temporary files. |
| 29 | * |
| 30 | * @return string[] |
| 31 | */ |
| 32 | public function getFiles() : array; |
| 33 | /** |
| 34 | * Reads data in file handles and pipes. |
| 35 | * |
| 36 | * @param bool $blocking Whether to use blocking calls or not |
| 37 | * @param bool $close Whether to close pipes if they've reached EOF |
| 38 | * |
| 39 | * @return string[] An array of read data indexed by their fd |
| 40 | */ |
| 41 | public function readAndWrite(bool $blocking, bool $close = \false) : array; |
| 42 | /** |
| 43 | * Returns if the current state has open file handles or pipes. |
| 44 | */ |
| 45 | public function areOpen() : bool; |
| 46 | /** |
| 47 | * Returns if pipes are able to read output. |
| 48 | */ |
| 49 | public function haveReadSupport() : bool; |
| 50 | /** |
| 51 | * Closes file handles and pipes. |
| 52 | */ |
| 53 | public function close(); |
| 54 | } |
| 55 |