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

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

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

    https://github.com/apache/thrift/pull/1479#discussion_r174183088
  
    --- 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.
    --- End diff --
    
    Better phrasing:
    
    `PSR-4` (make this a link to https://www.php-fig.org/psr/psr-4/) loader is 
now the default. If you want to use class maps instead, use `-gen php:classmap`.


> 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