Ben Meynell created THRIFT-3929:
-----------------------------------

             Summary: PHP "nsglobal" Option Results in Syntax Error in 
Generated Code (Trailing Backslash)
                 Key: THRIFT-3929
                 URL: https://issues.apache.org/jira/browse/THRIFT-3929
             Project: Thrift
          Issue Type: Bug
          Components: PHP - Compiler
    Affects Versions: 1.0
         Environment: Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:        14.04
Codename:       trusty
            Reporter: Ben Meynell
             Fix For: 1.0


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to