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

    • 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment