You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by "red.di.baron" <re...@gmail.com> on 2012/12/10 22:25:45 UTC

version 0.9.0 php generating trouble

HI!

I have trouble with generating php services by thrift version 0.9.0
(windows)

version 0.8.0 generate a folder named as original thrift file and two files
in the folder : one for service and one for types(structures etc).
Service's file name is "service_name.php" and types is
"thirft_original_name"+"_types"."php".

so for follow file  "firstService.thrift" :
-------------------
namespace php Services

struct A {
  1: i32 num = 0,
}

service FirstService {
A doIt();
}
--------------------

it generate by command:

thrift --gen php:server,namespace "firstService.thrift"

folder structure:
                   gen-php/firstService/
                               FirstService.php
                               firstService_types.php


version 0.9.0 generate by same command:

                    gen-php/Services/
                             FirstService.php
                             Types.php


Notice that directory named by name of namespace ( good way but
incompatible with prev version) and types placed into Types.php (???)
without any prefixes of suffiexes.

So when I try to generate next file "secondService.thrift":
-------------------
namespace php Services

struct B {
  1: i32 num = 0,
}

service SecondService {
B doIt();
}
-------------------
I get :
                    gen-php/Services/
                             FirstService.php
                             SecondService.php
                             Types.php

and Types.php contains code for "struct B" only (suprise!).

which make impossible to use FirstService.

I've tried each of php generation keys, but it generate same file structure
for each case.


So question: how I can generate correct files structures, where Types.php
not belong only for last compiled thrift?

I have a lot thrift files(


Thanks1