[
https://issues.apache.org/jira/browse/THRIFT-3929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15492143#comment-15492143
]
ASF GitHub Bot commented on THRIFT-3929:
----------------------------------------
GitHub user RobberPhex opened a pull request:
https://github.com/apache/thrift/pull/1089
THRIFT-3929 php namespace remove tail "\\"
when namespace is empty, and global namespace is not empty, don't add tail
"\\"
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/RobberPhex/thrift THRIFT-3929
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1089.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1089
----
commit d2a8c366f0d99ce20c434d7210ca8cdd289ff910
Author: Robert Lu <[email protected]>
Date: 2016-09-15T02:48:16Z
THRIFT-3929 php namespace remove tail "\\"
----
> 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
> Labels: easyfix
> 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)