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

PHP "nsglobal" Option Results in Syntax Error in Generated Code (Trailing Backslash)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.3
    • 0.10.0
    • PHP - Compiler
    • Distributor ID: Ubuntu
      Description: Ubuntu 14.04.4 LTS
      Release: 14.04
      Codename: trusty

    Description

      thrift --gen php:server,psr4,oop,validate,json,nsglobal="My\Special\Place" -out ./src my.thrift

      Results in PHP files with namespaces defined as:

      namespace My\Special\Place\;

      Note the trailing backslash ("\"). This results in unparseable PHP:

      $ php -l src/My/Special/Place/Data.php
      Errors parsing src/My/Special/Place/Data.php

      The fix is to simply omit the trailing backslash from the generated code.

      Attachments

        Issue Links

          Activity

            People

              bmeynell Ben Meynell
              bmeynell Ben Meynell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: