Resolve typedefs in php generation

Reviewed By: xsd


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Slee 2007-01-18 20:00:11 +00:00
parent 06098d7586
commit ace6e6dbc0

View File

@ -830,9 +830,13 @@ void t_php_generator::generate_service_rest(t_service* tservice) {
const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
vector<t_field*>::const_iterator a_iter;
for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
t_type* atype = (*a_iter)->get_type();
while (atype->is_typedef()) {
atype = ((t_typedef*)atype)->get_type();
}
f_service_ <<
indent() << "$" << (*a_iter)->get_name() << " = $request['" << (*a_iter)->get_name() << "'];" << endl;
if ((*a_iter)->get_type()->is_list()) {
if (atype->is_list()) {
f_service_ <<
indent() << "$" << (*a_iter)->get_name() << " = explode(',', $" << (*a_iter)->get_name() << ");" << endl;
}