PHP code example of phptars / tars-client

1. Go to this page and download the library: Download phptars/tars-client 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/ */

    

phptars / tars-client example snippets



$config = new \Tars\client\CommunicatorConfig();

$config->setLocator("tars.tarsregistry.QueryObj@tcp -h 172.16.0.161 -p 17890");



$route['sIp'] = "127.0.0.1";

$route['iPort'] = 8080;

$routeInfo[] = $route;

$config = new \Tars\client\CommunicatorConfig();

$config->setRouteInfo($routeInfo);