Advertisement
PhippsyB

gayServer.php

Feb 22nd, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?
  2. $GLOBALS['THRIFT_ROOT'] = '/usr/lib/php';
  3.  
  4. require_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
  5. require_once $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php';
  6. require_once $GLOBALS['THRIFT_ROOT'].'/transport/TPhpStream.php';
  7. require_once $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php';
  8.  
  9. $GEN_DIR = '/usr/lib/php/gen-php/gaybear/';
  10.  
  11. require_once $GEN_DIR.'/addTest.php';
  12. require_once $GEN_DIR.'/gaybear_types.php';
  13.  
  14. class addHandler {
  15.  
  16. public function ping() {
  17. }
  18.  
  19. public function add($num1, $num2) {
  20. return $num1 + $num2;
  21. }
  22.  
  23. public function zip() {
  24. }
  25. }
  26.  
  27. $handler = new addHandler();
  28. $processor = new addTest($handler);
  29.  
  30. $transport = new TBufferedTransport(new TPhpStream(TPhpStream::MODE_R | TPhpStream::MODE_W));
  31. $protocol = new TBinaryProtocol($transport, true, true);
  32.  
  33. $transport->open();
  34. $processor->process($protocol, $protocol);
  35. $transport->close();
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement