2017 © Pedro Peláez
 

library tars-assistant

phpassistant for tars client

image

phptars/tars-assistant

phpassistant for tars client

  • Sunday, February 4, 2018
  • by phptars
  • Repository
  • 2 Watchers
  • 3 Stars
  • 120 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 9 Versions
  • 30 % Grown

The README.md

phptars/tars-assistant

phptars是一个用于调用tars服务的php帮助类,其中对phptars扩展中的打包解包和网络收发进行了封装。, (*1)

使用方式

  1. 使用phpstorm的同学,请访问https://github.com/yuewenweb/tars-ide-helper,下载并引入到phpstorm的依赖库中,即可获得php扩展中的函数和代码的自动提示, (*2)

  2. 将example.tars文件放入与tars2php同级文件夹, (*3)

  3. 执行php tars2php.php example.tars "App.Server.Servant",其后后两个参数分别为tars文件的文件名和tars服务的servantName, (*4)

  4. 在composer.json中指定require类库:, (*5)

    "phptars/tars-assistant" : "vx.x.x"
  1. 执行composer install命令安装类库,此时会出现vendor目录, (*6)

  2. 开始写业务代码, (*7)

<?php

    require_once "./vendor/autoload.php";

    $ip = "";// taf服务ip
    $port = 0;// taf服务端口
    $hello = new \TestApp\HelloServer\HelloObj\Hello($ip,$port);

    // 或使用主控寻址
    $_SERVER['LOCATOR_IP'] = "172.16.0.161";
    $_SERVER['LOCATOR_PORT'] = 17890;
    // 无需指定ip和端口
    $hello = new \TestApp\HelloServer\HelloObj\Hello();

    try {
        $hello->testHello("test",$rsp);
        var_dump($rsp);
    }
    catch(phptars\TarsException $e) {
        // 错误处理
    }



The Versions

04/02 2018

dev-master

9999999-dev

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Chen Liang

04/02 2018

v0.2.1

0.2.1.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Chen Liang

17/10 2017

0.1.7

0.1.7.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php <=7.1.10

 

by Chen Liang

09/10 2017

0.1.6

0.1.6.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php ~5.5

 

by Chen Liang

09/10 2017

0.1.5

0.1.5.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php ~5.5

 

by Chen Liang

06/09 2017

0.1.4

0.1.4.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php ~5.5

 

by Chen Liang

06/09 2017

0.1.3

0.1.3.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php >=5.5.15,<=5.6.30

 

by Chen Liang

17/07 2017

0.1.1

0.1.1.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php >=5.5.15,<=5.6.30

 

by Chen Liang

17/07 2017

v0.1.0

0.1.0.0

phpassistant for tars client

  Sources   Download

MIT

The Requires

  • php >=5.5.15,<=5.6.30

 

by Chen Liang