You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "B Armstrong (JIRA)" <ji...@apache.org> on 2011/09/07 19:35:10 UTC

[jira] [Issue Comment Edited] (THRIFT-1330) PHP Namespaces no longer generated

    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099122#comment-13099122 ] 

B Armstrong edited comment on THRIFT-1330 at 9/7/11 5:34 PM:
-------------------------------------------------------------

The 'namespace' options adds the PHP 5.3 style namespace, that is correct. I guess my bug was poorly written up.

The actual bug is that we can't get the PHP 5.2 style of "namespacing". AKA Prefixing all of the classes with the "namespace" name.

Here is the output with thrift 0.6.0:

$ thrift -version
Thrift version 0.6.0
$ thrift -gen php test.thrift 
$ grep "TestNamespace" gen-php/test/test_types.php && echo "Has namespace" || echo "NO NAMESPACE FOUND"
class TestNamespace_ItemX {
Has namespace

With thrift 0.7.0 and 0.8.0 we cannot get the old functionality to work.

      was (Author: barmstrong@qualtrics.com):
    The 'namespace' options adds the PHP 5.3 style namespace, that is correct. I guess my bug was poorly written up.

The actual bug is that we can't get the PHP 5.2 style of "namespacing". AKA Prefixing all of the classes with the namespace name.

Here is the output with thrift 0.6.0:

$ thrift -version
Thrift version 0.6.0
$ thrift -gen php test.thrift 
$ grep "TestNamespace" gen-php/test/test_types.php && echo "Has namespace" || echo "NO NAMESPACE FOUND"
class TestNamespace_ItemX {
Has namespace

With thrift 0.7.0 and 0.8.0 we cannot get the old functionality to work.
  
> PHP Namespaces no longer generated
> ----------------------------------
>
>                 Key: THRIFT-1330
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1330
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Compiler
>    Affects Versions: 0.7, 0.8
>         Environment: Mac OS X 10.6.8, CentOS 5.6, Ubuntu 11.04
>            Reporter: B Armstrong
>            Assignee: Jake Farrell
>            Priority: Critical
>
> PHP namespaces are not being generated, ever. PHP 5.3 namespace aren't generated either.
> The following will illustrate the bug. This works in Thrift 0.6.*
> $ thrift -version
> Thrift version 0.7.0
> $ cat > test.thrift
> namespace php TestNamespace
> struct ItemX {}
> $ thrift --gen php test.thrift
> $ grep "TestNamespace" gen-php/test/test_types.php && echo "Has namespace" || echo "NO NAMESPACE FOUND"
> NO NAMESPACE FOUND
> $ thrift -version
> Thrift version 0.8.0-dev
> $ thrift -gen php test.thrift 
> $ grep "TestNamespace" gen-php/test/test_types.php && echo "Has namespace" || echo "NO NAMESPACE FOUND"
> NO NAMESPACE FOUND

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira