June 2017
Intermediate to advanced
536 pages
9h 49m
English
The thrift-service/server/ directory is where we will implement our project's server bits. Let's create a single all-in-one thrift-service/server/index.php file that implements the hello() and goodbye() methods and exposes them through the http://thrift-service.server/index.php for any thrift request that may come in:
<?phprequire_once __DIR__ . '/../vendor/thrift/lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';use Thrift\ClassLoader\ThriftClassLoader;use Thrift\Transport\TPhpStream;use Thrift\Transport\TBufferedTransport;use Thrift\Protocol\TBinaryProtocol;use user\GreetingServiceProcessor;use user\GreetingServiceIf;$loader = new ThriftClassLoader();$loader->registerNamespace('Thrift', __DIR__ . '/../vendor/thrift/lib/php/lib'); ...Read now
Unlock full access