PipesInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Process\Pipes;
  11. /**
  12. * PipesInterface manages descriptors and pipes for the use of proc_open.
  13. *
  14. * @author Romain Neutron <imprec@gmail.com>
  15. *
  16. * @internal
  17. */
  18. interface PipesInterface
  19. {
  20. const CHUNK_SIZE = 16384;
  21. /**
  22. * Returns an array of descriptors for the use of proc_open.
  23. *
  24. * @return array
  25. */
  26. public function getDescriptors();
  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();
  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($blocking, $close = false);
  42. /**
  43. * Returns if the current state has open file handles or pipes.
  44. *
  45. * @return bool
  46. */
  47. public function areOpen();
  48. /**
  49. * Closes file handles and pipes.
  50. */
  51. public function close();
  52. }