tokenize-query 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * Proxy PHP file generated by Composer
  5. *
  6. * This file includes the referenced bin path (../phpmyadmin/sql-parser/bin/tokenize-query)
  7. * using a stream wrapper to prevent the shebang from being output on PHP<8
  8. *
  9. * @generated
  10. */
  11. namespace Composer;
  12. $GLOBALS['_composer_bin_dir'] = __DIR__;
  13. $GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
  14. if (PHP_VERSION_ID < 80000) {
  15. if (!class_exists('Composer\BinProxyWrapper')) {
  16. /**
  17. * @internal
  18. */
  19. final class BinProxyWrapper
  20. {
  21. private $handle;
  22. private $position;
  23. private $realpath;
  24. public function stream_open($path, $mode, $options, &$opened_path)
  25. {
  26. // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
  27. $opened_path = substr($path, 17);
  28. $this->realpath = realpath($opened_path) ?: $opened_path;
  29. $opened_path = $this->realpath;
  30. $this->handle = fopen($this->realpath, $mode);
  31. $this->position = 0;
  32. return (bool) $this->handle;
  33. }
  34. public function stream_read($count)
  35. {
  36. $data = fread($this->handle, $count);
  37. if ($this->position === 0) {
  38. $data = preg_replace('{^#!.*\r?\n}', '', $data);
  39. }
  40. $this->position += strlen($data);
  41. return $data;
  42. }
  43. public function stream_cast($castAs)
  44. {
  45. return $this->handle;
  46. }
  47. public function stream_close()
  48. {
  49. fclose($this->handle);
  50. }
  51. public function stream_lock($operation)
  52. {
  53. return $operation ? flock($this->handle, $operation) : true;
  54. }
  55. public function stream_tell()
  56. {
  57. return $this->position;
  58. }
  59. public function stream_eof()
  60. {
  61. return feof($this->handle);
  62. }
  63. public function stream_stat()
  64. {
  65. return array();
  66. }
  67. public function stream_set_option($option, $arg1, $arg2)
  68. {
  69. return true;
  70. }
  71. public function url_stat($path, $flags)
  72. {
  73. $path = substr($path, 17);
  74. if (file_exists($path)) {
  75. return stat($path);
  76. }
  77. return false;
  78. }
  79. }
  80. }
  81. if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
  82. include("phpvfscomposer://" . __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/tokenize-query');
  83. exit(0);
  84. }
  85. }
  86. include __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/tokenize-query';