1. Go to this page and download the library: Download bearsunday/thrift library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
protected function configure(): void
{
// Binding thirft app to a host called "sekai"
$this->override(new ImportThriftAppModule([
new ThriftApp('sekai', '127.0.0.1', '9090')
]));
}
echo $resource->get('page://self/?name=Sekai'); // "greeting": "Konichiwa Sekai" from local app
echo $resource->get('page://sekai/?name=World'); // "greeting": "Hello World" from remote(127.0.0.1:9090) app
// echo $resource->get('/?name=World'); // "greeting": "Hello World" from remote(127.0.0.1:9090) app