You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Mike Riley (Created) (JIRA)" <ji...@apache.org> on 2011/10/17 02:02:12 UTC
[jira] [Created] (THRIFT-1392) Enabling both namespaces and
autloading in generated PHP code won't work.
Enabling both namespaces and autloading in generated PHP code won't work.
-------------------------------------------------------------------------
Key: THRIFT-1392
URL: https://issues.apache.org/jira/browse/THRIFT-1392
Project: Thrift
Issue Type: Bug
Components: PHP - Compiler
Affects Versions: 0.7
Environment: PHP 5.3.2
Reporter: Mike Riley
Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
* Append namespaces to the top of the file
* Use the non-backslash-prefixed namespace declaration for the autoloader key
I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autloading in generated PHP code won't work.
Posted by "Mike Riley (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Riley updated THRIFT-1392:
-------------------------------
Attachment: THRIFT-1392.patch
> Enabling both namespaces and autloading in generated PHP code won't work.
> -------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autoloading in generated PHP code won't work.
Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131243#comment-13131243 ]
Jake Farrell commented on THRIFT-1392:
--------------------------------------
Mike, if you would like to contribute a fix for this and Thrift-1330 i'd be glad to look it over and get it committed
> Enabling both namespaces and autoloading in generated PHP code won't work.
> --------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autoloading in generated PHP code won't work.
Posted by "Mike Riley (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Riley updated THRIFT-1392:
-------------------------------
Summary: Enabling both namespaces and autoloading in generated PHP code won't work. (was: Enabling both namespaces and autloading in generated PHP code won't work.)
This patch won't actually solve the problem unless applied to services / clients as well. I'd be happy to pull the pertinent parts out of my current changes for a new patch if someone thinks this is worthwhile applying.
> Enabling both namespaces and autoloading in generated PHP code won't work.
> --------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autoloading in generated PHP code won't work.
Posted by "Jake Farrell (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jake Farrell updated THRIFT-1392:
---------------------------------
Fix Version/s: 0.8
> Enabling both namespaces and autoloading in generated PHP code won't work.
> --------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Fix For: 0.8
>
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autoloading in generated PHP code won't work.
Posted by "Jake Farrell (Closed) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jake Farrell closed THRIFT-1392.
--------------------------------
Resolution: Fixed
Assignee: Mike Riley
Patch provided in Thrift-1330
> Enabling both namespaces and autoloading in generated PHP code won't work.
> --------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Assignee: Mike Riley
> Fix For: 0.8
>
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autoloading in generated PHP code won't work.
Posted by "Mike Riley (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157575#comment-13157575 ]
Mike Riley commented on THRIFT-1392:
------------------------------------
Correct.
> Enabling both namespaces and autoloading in generated PHP code won't work.
> --------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Fix For: 0.8
>
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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-1392) Enabling both namespaces and
autoloading in generated PHP code won't work.
Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157574#comment-13157574 ]
Jake Farrell commented on THRIFT-1392:
--------------------------------------
Mike, this patch is no longer necessary due to the r1 patch provided in Thrift-1330 correct?
> Enabling both namespaces and autoloading in generated PHP code won't work.
> --------------------------------------------------------------------------
>
> Key: THRIFT-1392
> URL: https://issues.apache.org/jira/browse/THRIFT-1392
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.7
> Environment: PHP 5.3.2
> Reporter: Mike Riley
> Fix For: 0.8
>
> Attachments: THRIFT-1392.patch
>
>
> Using --gen php:autoload=1,namespace=1 won't work because the generated types don't have namespaces declared and the autoloader pulls in the individual files.
> I've attached a simple patch from the latest SVN trunk that will do two things inside t_php_generator::generate_php_struct_definition:
> * Append namespaces to the top of the file
> * Use the non-backslash-prefixed namespace declaration for the autoloader key
> I'm a little confused as to why there were even namespaces being written into the autoloader array at all when they were prefixed with a backslash, and __autoload receives class names without a leading backslash.
--
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