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:07:09 UTC

[jira] [Created] (THRIFT-1330) PHP Namespaces no longer generated

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
         Environment: Mac OS X 10.6.8, CentOS 5.6, Ubuntu 11.04
            Reporter: B Armstrong
            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

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

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153935#comment-13153935 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

While using this today I noticed that constants are written out awkwardly with modern namespacing enabled, I'm updating the patch.
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131958#comment-13131958 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

I'm going to tackle this and Thrift-1392, what are reasonable target PHP version(s) to use in testing backwards compatibility?
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Ruslan Shevchenko (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151218#comment-13151218 ] 

Ruslan Shevchenko commented on THRIFT-1330:
-------------------------------------------

Note, that this also brokes php tutorial.
                
> 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
>             Fix For: 0.8
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131965#comment-13131965 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

Thanks Mike, I would look at php 5.2 and 5.3
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157993#comment-13157993 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

Is this based off of the commit message or have you seen it behave incorrectly?  I tested this on PHP 5.2.
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157572#comment-13157572 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

the php lib has been one of the more neglected libraries we have, trying to make sure all bases are covered and that we don't introduce any new issues. The patch looked good to me, just wanted to double check before committing 
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Riley updated THRIFT-1330:
-------------------------------

    Attachment: thrift-1392-1330r1.patch
    
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "B Armstrong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099134#comment-13099134 ] 

B Armstrong commented on THRIFT-1330:
-------------------------------------

It should be noted that this bug is reporting that the "compatibility with older versions of php" has been broken.

> 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

        

[jira] [Updated] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Riley updated THRIFT-1330:
-------------------------------

    Attachment: thrift-1392-1330.patch

I ran this against my project and a few contrived tests combining the old/new namespacing and autoloading parameters.

The scope of changes is relatively wide so if anyone has better testing code that uses namespacing and/or autoloading it would help.
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141192#comment-13141192 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

If you want to attach an initial working copy of the patch I can help rebase the patch against trunk. If you need help getting your server to work with the current trunk send an email to the dev list with the issue and we can help get it working
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099204#comment-13099204 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

THRIFT-1241 introduced the php namespaces, would make sense to set the NS_ROOT with older style namespace for php classes < 5.3. If you would like to provide a patch for this that would be great, otherwise i can tackle it after some of the other tickets i have

> 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

        

[jira] [Closed] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell closed THRIFT-1330.
--------------------------------

    Resolution: Not A Problem
      Assignee: Jake Farrell

the compiler was given a 'namespace' option to not break compatibility with older versions of php. From thrift --help

    namespace:       Generate PHP namespaces as defined in PHP >= 5.3


> thrift --gen php:namespace test.thrift
> grep "TestNamespace" gen-php/test/test_types.php && echo "Has namespace" || echo "NO NAMESPACE FOUND"
namespace TestNamespace;
Has namespace

> 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

        

[jira] [Reopened] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "B Armstrong (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B Armstrong reopened THRIFT-1330:
---------------------------------


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

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "B Armstrong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099127#comment-13099127 ] 

B Armstrong commented on THRIFT-1330:
-------------------------------------

It should be noted that this bug is reporting that the "compatibility with older version of php" has been broken.

> 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

        

[jira] [Updated] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "B Armstrong (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B Armstrong updated THRIFT-1330:
--------------------------------

    Comment: was deleted

(was: It should be noted that this bug is reporting that the "compatibility with older version of php" has been broken.)

> 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

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157583#comment-13157583 ] 

Hudson commented on THRIFT-1330:
--------------------------------

Integrated in Thrift #343 (See [https://builds.apache.org/job/Thrift/343/])
    Thrift-1330: PHP Namespaces no longer generated
Client: php
Patch: Mike Riley

Fixes namespaces in PHP generator to with with php >= 5.3.x

                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jon Stephens (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178934#comment-13178934 ] 

Jon Stephens commented on THRIFT-1330:
--------------------------------------

This is not fully fixed yet, enums are still broken:

{code}
$ cat test.thrift 
namespace php TestNamespace
enum MyEnum {}
$ thrift -version
Thrift version 0.8.0
$ thrift --gen php test.thrift
$ grep "class TestNamespace" gen-php/test/test_types.php || echo "NO NAMESPACE FOUND"
NO NAMESPACE FOUND
$ thrift6 -version
Thrift version 0.6.0
$ thrift6 --gen php test.thrift
$ grep "class TestNamespace" gen-php/test/test_types.php || echo "NO NAMESPACE FOUND"
final class TestNamespace_MyEnum {
{code}
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147175#comment-13147175 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

Mike, any progress on this? would like to get this into the 0.8 release
                
> 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
>             Fix For: 0.8
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jon Stephens (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13191243#comment-13191243 ] 

Jon Stephens commented on THRIFT-1330:
--------------------------------------

Enum issue appears to be fixed in trunk.
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158004#comment-13158004 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

The ci server does not close issue only comments on them, I closed this issue. build #343 failed due to the python test case server not being able to bind to localhost:9090, nothing related to thrift-1330. The ci server has been showing this issue intermittently
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157541#comment-13157541 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

I can confirm this occurs, however this has been the behavior present since at least 0.7x, the file/folder structure is identical. I suppose it never really occurred to me that this was unexpected behavior since I am using namespaces to separate thrift code from my non-generated code and only have one namespace to worry about as far as thrift is concerned.

Could you describe the expected behavior for me so I can try and fix this?
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141180#comment-13141180 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

mike, any progress with this? i'm looking at starting the next release candidate soon and would like to get this resolved and added if its close to being completed
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157564#comment-13157564 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

Jake:

I'm a little confused at this point because I just looked back over the revision history for the autoloader and it doesn't seem to have ever changed.  The autoloader works by reading out of the $GLOBALS array to find the path to the specified resource. It should function correctly irrespective of any directory structure assuming you're writing out paths correctly into $GLOBALS.  What does worry me is that there seems to be a php.path namespace declarator, undocumented, which you can set in your thrift file.  I haven't explored what this does but I'm betting it will function similar to what you are expecting, which I assume is Zend style autoloading based on folder hierarchies matching class prefixes. I'm betting we have some kind of disconnect here on a basic level as far as how autoloading is supposed to work, which admittedly is probably my fault because I'm very new to thrift.

The specific example you emailed me, Thrift_Test_VersioningTestV1, to the best of my understanding, functions as expected.  I changed my namespace to Thrift.Test, which was properly prefixed to the class name in the declaration, usage would be as follows:

1. Included autoload.php in your script. 
2. Include the ThriftTest_types.php file to load the autoload paths.
3. Invoke 'new Thrift_Test_VersioningTestV1()'

This will cause the autoloader to find the following entry:

$GLOBALS['THRIFT_AUTOLOAD']['thrift_test_versioningtestv1'] = 'ThriftTest/ThriftTest.VersioningTestV1.php';

And correctly determine the path to the requested class allowing you to load it.

Could you try and clarify what the issue is here?
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Christoffer Sawicki (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157991#comment-13157991 ] 

Christoffer Sawicki commented on THRIFT-1330:
---------------------------------------------

This issue has been wrongfully closed; namespaces (i.e. class name prefixes) are still not supported for PHP < 5.3.
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157576#comment-13157576 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

I'm realizing we have needless / awkward prefixing in the class filenames but this is harmless because you can't have more than one namespace per .thrift file, so as long as there are unique filenames in the folder for each class there won't ever be issues there.

Time permitting, I was actually planning on getting Zend style autoloading to work so that you could use thrift resources as dropins to a Zend (or Pear) autoloaded environment.  The current autoloader prevents you from doing this without a little hacking.
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141184#comment-13141184 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

I have these fixed locally.  However, I'm working off of the 0.7 tag as I'm unable to get the C++ server libraries from trunk to work within my application.  AFAIK there is no conflict there but I haven't tried patching into trunk yet.

I also have several other areas within thrift that I've been tooling around with and will need to pluck only the pertinent parts out of the php compiler.

Won't take much time, but if it's all the same, I'd like to wait until Saturday to put it all together.
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Christoffer Sawicki (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157995#comment-13157995 ] 

Christoffer Sawicki commented on THRIFT-1330:
---------------------------------------------

OK, I'm sorry; it is fixed! Just not in build #343 that closed this issue.
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "B Armstrong (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B Armstrong updated THRIFT-1330:
--------------------------------

          Description: 
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

  was:
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

    Affects Version/s: 0.8

> 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
>            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

        

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

Posted by "B Armstrong (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157527#comment-13157527 ] 

Jake Farrell commented on THRIFT-1330:
--------------------------------------

Mike: Testing the r1 patch what does your autoloader look like for this when using autoload=1? When generated all files are dumped into one folder rather than being placed into any type of folder structure. This can be duplicated by changing the namespace in the test case from ThriftTest to Thrift.Test
                
> 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
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell updated THRIFT-1330:
---------------------------------

    Fix Version/s: 0.8
    
> 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
>             Fix For: 0.8
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13141243#comment-13141243 ] 

Mike Riley commented on THRIFT-1330:
------------------------------------

It's no problem, I want to make sure my other changes work against trunk as well, I knew I would have to do it eventually.  Unless it's a problem to wait until Saturday?
                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (THRIFT-1330) PHP Namespaces no longer generated

Posted by "Jake Farrell (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell closed THRIFT-1330.
--------------------------------

    Resolution: Fixed
      Assignee: Mike Riley  (was: Jake Farrell)

The zend autoloading should be another issue separate from this one. Thanks for the great work on this Mike, committed the r1 patch 
                
> 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: Mike Riley
>            Priority: Critical
>             Fix For: 0.8
>
>         Attachments: thrift-1392-1330.patch, thrift-1392-1330r1.patch
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira