jp.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * Proxy PHP file generated by Composer
  5. *
  6. * This file includes the referenced bin path (../mtdowling/jmespath.php/bin/jp.php) using ob_start to remove the shebang if present
  7. * to prevent the shebang from being output on PHP<8
  8. *
  9. * @generated
  10. */
  11. namespace Composer;
  12. $binPath = __DIR__ . "/" . '../mtdowling/jmespath.php/bin/jp.php';
  13. if (PHP_VERSION_ID < 80000) {
  14. if (!class_exists('Composer\BinProxyWrapper')) {
  15. /**
  16. * @internal
  17. */
  18. final class BinProxyWrapper
  19. {
  20. private $handle;
  21. private $position;
  22. public function stream_open($path, $mode, $options, &$opened_path)
  23. {
  24. // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution
  25. $opened_path = substr($path, 21);
  26. $opened_path = realpath($opened_path) ?: $opened_path;
  27. $this->handle = fopen($opened_path, $mode);
  28. $this->position = 0;
  29. // remove all traces of this stream wrapper once it has been used
  30. stream_wrapper_unregister('composer-bin-proxy');
  31. return (bool) $this->handle;
  32. }
  33. public function stream_read($count)
  34. {
  35. $data = fread($this->handle, $count);
  36. if ($this->position === 0) {
  37. $data = preg_replace('{^#!.*\r?\n}', '', $data);
  38. }
  39. $this->position += strlen($data);
  40. return $data;
  41. }
  42. public function stream_cast($castAs)
  43. {
  44. return $this->handle;
  45. }
  46. public function stream_close()
  47. {
  48. fclose($this->handle);
  49. }
  50. public function stream_lock($operation)
  51. {
  52. return $operation ? flock($this->handle, $operation) : true;
  53. }
  54. public function stream_tell()
  55. {
  56. return $this->position;
  57. }
  58. public function stream_eof()
  59. {
  60. return feof($this->handle);
  61. }
  62. public function stream_stat()
  63. {
  64. return fstat($this->handle);
  65. }
  66. public function stream_set_option($option, $arg1, $arg2)
  67. {
  68. return true;
  69. }
  70. }
  71. }
  72. if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) {
  73. include("composer-bin-proxy://" . $binPath);
  74. exit(0);
  75. }
  76. }
  77. include $binPath;