|
35 | 35 | } |
36 | 36 |
|
37 | 37 | if (!isset($autoloadPath)) { |
38 | | - \trigger_error( |
39 | | - "Could not locate autoload.php in any of the following files: " . \implode(", ", $paths), |
40 | | - E_USER_ERROR, |
41 | | - ); |
| 38 | + \file_put_contents('php://stderr', "Could not locate autoload.php in any of the following files: " . \implode(", ", $paths), \FILE_APPEND); |
| 39 | + exit(255); |
42 | 40 | } |
43 | 41 |
|
44 | 42 | /** @psalm-suppress UnresolvableInclude */ |
|
58 | 56 | /** @var list<string> $argv */ |
59 | 57 |
|
60 | 58 | if (!isset($argv[1])) { |
61 | | - \trigger_error("No socket path provided", E_USER_ERROR); |
| 59 | + \file_put_contents('php://stderr', "No socket path provided", \FILE_APPEND); |
| 60 | + exit(255); |
62 | 61 | } |
63 | 62 |
|
64 | 63 | if (!isset($argv[2]) || !\is_numeric($argv[2])) { |
65 | | - \trigger_error("No key length provided", E_USER_ERROR); |
| 64 | + \file_put_contents('php://stderr', "No key length provided", \FILE_APPEND); |
| 65 | + exit(255); |
66 | 66 | } |
67 | 67 |
|
68 | 68 | if (!isset($argv[3]) || !\is_numeric($argv[3])) { |
69 | | - \trigger_error("No timeout provided", E_USER_ERROR); |
| 69 | + \file_put_contents('php://stderr', "No timeout provided", \FILE_APPEND); |
| 70 | + exit(255); |
70 | 71 | } |
71 | 72 |
|
72 | 73 | [, $uri, $length, $timeout] = $argv; |
|
82 | 83 | $cancellation = new TimeoutCancellation($timeout); |
83 | 84 | $key = Ipc\readKey(ByteStream\getStdin(), $cancellation, $length); |
84 | 85 | } catch (\Throwable $exception) { |
85 | | - \trigger_error($exception->getMessage(), E_USER_ERROR); |
| 86 | + \file_put_contents('php://stderr', $exception->getMessage(), \FILE_APPEND); |
| 87 | + exit(255); |
86 | 88 | } |
87 | 89 |
|
88 | 90 | runContext($uri, $key, $cancellation, $argv); |
|
0 commit comments