2017 © Pedro Peláez
 

library thrift-laravel

use Thrift in Laravel

image

angejia/thrift-laravel

use Thrift in Laravel

  • Monday, September 19, 2016
  • by angejia
  • Repository
  • 2 Watchers
  • 7 Stars
  • 1,765 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

thrift-laravel

use Thrift in Laravel, (*1)

How to use

Server side

  1. composer require angejia/thrift-laravel
  2. add provider to app.providers: \Angejia\Thrift\ThriftServiceProvider::class
  3. setting thrift.providers in file config/thrift.php: // first is service name, defined in thrift file // second in Service implement reference, e.g. // class ImageServcie implement \Angejia\ImageServiceIf ['Angejia.ImageService', \Angejia\ImageService::class],
  4. add Middleware \Angejia\Thrift\Middleware\ThriftServerMiddleware::class to app\Http\Kernel, (*2)

    in default, the request to /rpc will be process by Middleware, if you want to change this, please extend ThriftServerMiddleware and overwrite process method, (*3)

Client side

  1. composer require angejia/thrift-laravel
  2. add provider in app.providers: \Angejia\Thrift\ThriftServiceProvider::class
  3. setting thrift.depends in file config/thrift.php: // key is url // value is array of service name "http://localhost/rpc" => [ 'Angejia.ImageService', ]
  4. usage:, (*4)

    /** @var \Angejia\Thrift\Contracts\ThriftClient $thriftClient */
    $thriftClient = app(\Angejia\Thrift\Contracts\ThriftClient::class);
    /** @var \Angejia\ImageServiceIf $imageService */
    $imageService = $thriftClient->with('Angejia.ImageService');
    
    $result = $imageService->foo();
    

TODO

  • Unittest

The Versions

19/09 2016
06/09 2016

0.2.12

0.2.12.0

use Thrift in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

05/09 2016

0.2.11

0.2.11.0

use Thrift in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

02/09 2016

0.2.10

0.2.10.0

use Thrift in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

29/08 2016
29/08 2016
29/08 2016

0.1.0

0.1.0.0

thrift in laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

29/08 2016

0.2.0

0.2.0.0

thrift in laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

29/08 2016

0.2.1

0.2.1.0

thrift in laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

29/08 2016

0.2.2

0.2.2.0

thrift in laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

29/08 2016

0.2.3

0.2.3.0

thrift in laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel thrift

18/08 2016