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

Robert Lu commented on THRIFT-4474:
-----------------------------------

Maybe this is a break change.

The code generated by old thrift compiler and new thrift compiler both can be 
loaded via classmap method(in composer).

But, \Thrift\ClassLoader\ThriftClassLoader donot use classmap, it just find 
class in Service.php or Types.php, so code generated by psr4 compiler *cannot* 
be load via \Thrift\ClassLoader\ThriftClassLoader::registerDefinition. 
\Thrift\ClassLoader\ThriftClassLoader::registerNamespace should be used. 


> PHP generator use PSR-4 default
> -------------------------------
>
>                 Key: THRIFT-4474
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4474
>             Project: Thrift
>          Issue Type: Improvement
>          Components: PHP - Compiler
>            Reporter: Robert Lu
>            Assignee: Robert Lu
>            Priority: Major
>
> Before, PHP generator generate php files like {{Types.php}}, {{Service.php}}.
> Those can only be load via 
> [{{classmap}}|https://getcomposer.org/doc/04-schema.md#classmap] method. The 
> latest PSR about autoload is [PSR-4|http://www.php-fig.org/psr/psr-4/].
> thrift compiler can generate PSR-4 code default, if want old-style code(which 
> can only load via classmap), add {{classmap}} option.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to