MCPcopy Create free account
hub / github.com/apache/thrift / makeProtocol

Function makeProtocol

test/php/TestClient.php:60–78  ·  view source on GitHub ↗
($transport, $PROTO)

Source from the content-addressed store, hash-verified

58use Thrift\Transport\TBufferedTransport;
59
60function makeProtocol($transport, $PROTO)
61{
62 if ($PROTO == 'binary') {
63 return new TBinaryProtocol($transport);
64 } else if ($PROTO == 'compact') {
65 return new TCompactProtocol($transport);
66 } else if ($PROTO == 'json') {
67 return new TJSONProtocol($transport);
68 } else if ($PROTO == 'accel') {
69 if (!function_exists('thrift_protocol_write_binary')) {
70 echo "Acceleration extension is not loaded\n";
71 exit(1);
72 }
73 return new TBinaryProtocolAccelerated($transport);
74 }
75
76 echo "--protocol must be one of {binary|compact|json|accel}\n";
77 exit(1);
78}
79
80$host = 'localhost';
81$port = 9090;

Callers 1

TestClient.phpFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected