MockStream.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\Filesystem\Tests\Fixtures\MockStream;
  11. /**
  12. * Mock stream class to be used with stream_wrapper_register.
  13. * stream_wrapper_register('mock', 'Symfony\Component\Filesystem\Tests\Fixtures\MockStream\MockStream').
  14. */
  15. class MockStream
  16. {
  17. /**
  18. * Opens file or URL.
  19. *
  20. * @param string $path Specifies the URL that was passed to the original function
  21. * @param string $mode The mode used to open the file, as detailed for fopen()
  22. * @param int $options Holds additional flags set by the streams API
  23. * @param string $opened_path If the path is opened successfully, and STREAM_USE_PATH is set in options,
  24. * opened_path should be set to the full path of the file/resource that was actually opened
  25. *
  26. * @return bool
  27. */
  28. public function stream_open($path, $mode, $options, &$opened_path)
  29. {
  30. return true;
  31. }
  32. /**
  33. * @param string $path The file path or URL to stat
  34. * @param array $flags Holds additional flags set by the streams API
  35. *
  36. * @return array File stats
  37. */
  38. public function url_stat($path, $flags)
  39. {
  40. return array();
  41. }
  42. }