thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default
Date Wed, 14 Mar 2018 02:24:00 GMT

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

ASF GitHub Bot commented on THRIFT-4474:
----------------------------------------

Github user RobberPhex commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1479#discussion_r174337789
  
    --- Diff: lib/php/README.md ---
    @@ -20,34 +19,46 @@ KIND, either express or implied. See the License for the
     specific language governing permissions and limitations
     under the License.
     
    -Using Thrift with PHP
    -=====================
    +# Using Thrift with PHP
     
     Thrift requires PHP 5. Thrift makes as few assumptions about your PHP
     environment as possible while trying to make some more advanced PHP
     features (i.e. APC cacheing using asbolute path URLs) as simple as possible.
     
     To use Thrift in your PHP codebase, take the following steps:
     
    -#1) Copy all of thrift/lib/php/lib into your PHP codebase
    -#2) Configure Symfony Autoloader (or whatever you usually use)
    +1. Copy all of thrift/lib/php/lib into your PHP codebase
    +2. Configure Symfony Autoloader (or whatever you usually use)
     
     After that, you have to manually include the Thrift package
     created by the compiler:
     
    +```
     require_once 'packages/Service/Service.php';
     require_once 'packages/Service/Types.php';
    +```
     
    -Dependencies
    -============
    +# Dependencies
     
     PHP_INT_SIZE
     
    -  This built-in signals whether your architecture is 32 or 64 bit and is
    -  used by the TBinaryProtocol to properly use pack() and unpack() to
    -  serialize data.
    +    This built-in signals whether your architecture is 32 or 64 bit and is
    +    used by the TBinaryProtocol to properly use pack() and unpack() to
    +    serialize data.
     
     apc_fetch(), apc_store()
     
    -  APC cache is used by the TSocketPool class. If you do not have APC installed,
    -  Thrift will fill in null stub function definitions.
    +    APC cache is used by the TSocketPool class. If you do not have APC installed,
    +    Thrift will fill in null stub function definitions.
    +
    +# Breaking Changes
    +
    +## 0.12.0
    +
    +1. For thrift compiler, `psr4` flag is opened default, generated code match psr4 code
struct.
    +
    +    If you want old-style directory struct, use `classmap` option. (i.e. `-gen php:classmap`)
    +
    +2. For ThriftClassloader, if use psr4 code struct, must use `$thriftClassLoader->registerNamespace('namespace',
'<path>')` to register autoload.
    --- End diff --
    
    Thank you! It's better phrasing.
    
    ---
    
    Fixed by amend comment.


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

Mime
View raw message