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