thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default
Date Tue, 30 Jan 2018 13:37:00 GMT


ASF GitHub Bot commented on THRIFT-4474:

Github user RobberPhex commented on the issue:
    There are some break changes:
    1. for generated code, old struct is `Types.php` for all args, results, `<Service>.php`
for `ServiceIf`, `ServiceClient`, etc.
      new struct is `<classname>.php` for `<class>`. Maybe cause some code analyzer
doesn't work.
    2. for ThriftClassloader. before, user use `$loader->registerDefinition('namespace',
      At new struct, **it doesn't work**. user can use `$composerLoader->addPsr4('namespace',
'<path>')` or `$thriftLoader->registerNamespace('namespace', '<path>')`.
    3. for composer loader, generated code loaded via classmap. With new struct, composer's
classmap can also load psr-4 code. (of cause psr-4 is recommended).

> PHP generator use PSR-4 default
> -------------------------------
>                 Key: THRIFT-4474
>                 URL:
>             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}}|]
method. The latest PSR about autoload is [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

View raw message