Thrift compiler support for inline PHP client code
Summary: Option to generate inline PHP code, as well as support for the async modifier keyword and the abstraction of function calls into a send and recv component
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664740 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/src/main.cc b/compiler/src/main.cc
index 8783309..6a7faf8 100644
--- a/compiler/src/main.cc
+++ b/compiler/src/main.cc
@@ -98,6 +98,7 @@
fprintf(stderr, " -cpp Generate C++ output files\n");
fprintf(stderr, " -java Generate Java output files\n");
fprintf(stderr, " -php Generate PHP output files\n");
+ fprintf(stderr, " -phpi Generate PHP inlined files\n");
//fprintf(stderr, " -python Generate Python output files\n");
fprintf(stderr, " -d Print parse debugging to standard output\n");
exit(1);
@@ -111,6 +112,7 @@
bool gen_cpp = false;
bool gen_java = false;
bool gen_php = false;
+ bool php_inline = false;
// Setup time string
time_t now = time(NULL);
@@ -130,6 +132,10 @@
gen_java = true;
} else if (strcmp(argv[i], "-php") == 0) {
gen_php = true;
+ php_inline = false;
+ } else if (strcmp(argv[i], "-phpi") == 0) {
+ gen_php = true;
+ php_inline = true;
} else {
fprintf(stderr, "!!! Unrecognized option: %s\n", argv[i]);
usage();
@@ -181,7 +187,7 @@
}
if (gen_php) {
- t_php_generator* php = new t_php_generator();
+ t_php_generator* php = new t_php_generator(php_inline);
php->generate_program(g_program);
delete php;
}