From: David Reiss Date: Wed, 16 Sep 2009 16:57:05 +0000 (+0000) Subject: THRIFT-584. php: Generate a better directory structure X-Git-Tag: 0.2.0~32 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=bb97bef0a11e7ace7d76f2af670c4b2d6fb99efe;p=common%2Fthrift.git THRIFT-584. php: Generate a better directory structure git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@815878 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc index 436a6325..38a63faa 100644 --- a/compiler/cpp/src/generate/t_php_generator.cc +++ b/compiler/cpp/src/generate/t_php_generator.cc @@ -193,6 +193,7 @@ class t_php_generator : public t_oop_generator { std::ofstream f_helpers_; std::ofstream f_service_; + std::string package_dir_; /** * Generate protocol-independent template? Or Binary inline code? */ @@ -230,9 +231,10 @@ class t_php_generator : public t_oop_generator { void t_php_generator::init_generator() { // Make output directory MKDIR(get_out_dir().c_str()); - + package_dir_ = get_out_dir()+"/"+program_name_+"/"; + MKDIR(package_dir_.c_str()); // Make output file - string f_types_name = get_out_dir()+program_name_+"_types.php"; + string f_types_name = package_dir_+program_name_+"_types.php"; f_types_.open(f_types_name.c_str()); // Print header @@ -252,7 +254,7 @@ void t_php_generator::init_generator() { // Print header if (!program_->get_consts().empty()) { - string f_consts_name = get_out_dir()+program_name_+"_constants.php"; + string f_consts_name = package_dir_+program_name_+"_constants.php"; f_consts_.open(f_consts_name.c_str()); f_consts_ << "get_name())+".php"; - string f_struct_name = get_out_dir()+f_struct; + string f_struct_name = package_dir_+f_struct; autoload_out.open(f_struct_name.c_str()); autoload_out << "get_name())+".client.php"; - string f_struct_name = get_out_dir()+f_struct; + string f_struct_name = package_dir_+f_struct; autoload_out.open(f_struct_name.c_str()); autoload_out << "