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

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.10.0
    • Component/s: PHP - Compiler
    • Labels:
    • Environment:

      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

          Activity

            People

            • Assignee:
              bmeynell Ben Meynell
              Reporter:
              bmeynell Ben Meynell

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment