Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.7
-
None
-
PHP 5.3.2
-
Patch Available
Description
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.
Attachments
Attachments
Issue Links
- relates to
-
THRIFT-1330 PHP Namespaces no longer generated
- Closed