init
This commit is contained in:
33
vendor/valga/fbns-react/bin/thrift_debug
vendored
Executable file
33
vendor/valga/fbns-react/bin/thrift_debug
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
if ($argc > 1) {
|
||||
$data = @file_get_contents($argv[1]);
|
||||
} elseif (!posix_isatty(STDIN)) {
|
||||
$data = @stream_get_contents(STDIN);
|
||||
} else {
|
||||
echo 'Usage: ', $argv[0], ' [FILE]', PHP_EOL;
|
||||
echo 'Dump the contents of Thrift FILE.', PHP_EOL;
|
||||
echo PHP_EOL;
|
||||
echo 'With no FILE read standard input.', PHP_EOL;
|
||||
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if ($data === false) {
|
||||
fwrite(STDERR, 'Failed to read the input.'.PHP_EOL);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
new \Fbns\Client\Thrift\Debug($data);
|
||||
} catch (\Exception $e) {
|
||||
fwrite(STDERR, $e->getMessage().PHP_EOL);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
Reference in New Issue
Block a user