Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1905

Struct names with underscores get mangled in PHP compiled output

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9
    • Fix Version/s: None
    • Component/s: PHP - Compiler
    • Labels:
      None
    • Environment:

      Centos 6.4

      Description

      When compiling a thrift file containing a struct name with underscores, the underscores get stripped out in the name if the struct is used as a type hint in a function definition.

      EXAMPLE THRIFT FILE
      ------------------------------------------------------------------

      namespace php TEST
      
      struct Test_SQL_Row {
          1: map<string,string> row
      }
      
      service New_Service {
      
          i16 Tester(1:Test_SQL_Row row),
      }
      

      ------------------------------------------------------------------

      SNIPPET FROM COMPILED OUTPUT
      Command: thrift -r --gen php bad.thrift
      ------------------------------------------------------------------

        public function Tester(\TEST\TestSQLRow $row)
        {
          $this->send_Tester($row);
          return $this->recv_Tester();
        }
      

      ------------------------------------------------------------------

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              siliconengine Tim Behrendsen
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: