| Volodymyr Panivko | 68139d1 | 2024-03-19 23:14:07 +0100 | [diff] [blame] | 1 | <?php | 
|  | 2 |  | 
|  | 3 | use Thrift\Protocol\TCompactProtocol; | 
|  | 4 | use Thrift\Transport\THttpClient; | 
|  | 5 |  | 
|  | 6 | error_reporting(E_ALL); | 
|  | 7 |  | 
|  | 8 | require_once __DIR__ . '/../../vendor/autoload.php'; | 
|  | 9 |  | 
|  | 10 | $loader = new Thrift\ClassLoader\ThriftClassLoader(); | 
|  | 11 | $loader->registerDefinition('ThriftTest', __DIR__ . '/../../lib/php/test/Resources/packages/phpcm'); | 
|  | 12 | $loader->register(); | 
|  | 13 |  | 
|  | 14 |  | 
|  | 15 | $transport = new THttpClient('localhost', 80); | 
|  | 16 |  | 
|  | 17 | $transport->setTimeoutSecs($this->timeoutSec); | 
|  | 18 |  | 
|  | 19 | $transport->addHeaders($this->generateAuthHeader()); | 
|  | 20 |  | 
|  | 21 | $protocol = new TCompactProtocol($transport); | 
|  | 22 |  | 
|  | 23 | $transport->open(); | 
|  | 24 |  | 
|  | 25 | $client = new \ThriftTest\ThriftTestClient($protocol); | 
|  | 26 | $client->testVoid(); |