[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-15 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user asfgit closed the pull request at:

https://github.com/apache/thrift/pull/1479


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user RobberPhex commented on the issue:

https://github.com/apache/thrift/pull/1479
  
@dcelasun squashed


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user dcelasun commented on the issue:

https://github.com/apache/thrift/pull/1479
  
@RobberPhex can you squash your commits?


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-4474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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', '')` 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)


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-4474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-13 Thread ASF GitHub Bot (JIRA)

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

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_r174183533
  
--- 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', '')` to register 
autoload.
--- End diff --

Better phrasing:

If using PSR4, use `$thriftClassLoader->registerNamespace('namespace', 
'')` instead of `$thriftClassLoader->registerDefinition('namespace', 
'')`.


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user dcelasun commented on the issue:

https://github.com/apache/thrift/pull/1479
  
Added some doc comments. The actual code looks fine to me.


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user jeking3 commented on the issue:

https://github.com/apache/thrift/pull/1479
  
Any other php folks out there want to comment or review on the breaking 
change here?  It looks like the strategy was to change the generator and 
provide a flag to allow folks to generate older style code for backwards 
compatibility.


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-03-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user jeking3 commented on the issue:

https://github.com/apache/thrift/pull/1479
  
Document all breaking changes in the language README.


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-01-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user jeking3 commented on the issue:

https://github.com/apache/thrift/pull/1479
  
If we are making breaking changes, they need to be documented very clearly 
in the php/README.md file as part of any commit.  See my breaking changes for 
0.10.0 and 0.11.0 in the perl/README.md for an example of what I mean.  I'm not 
certain anybody on the mailing list is listening at this point, but if anyone 
has an interest in php breaking changes, you need to chime in.


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-01-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user RobberPhex commented on the issue:

https://github.com/apache/thrift/pull/1479
  
Personally, I think we can mark classmap/old-style PHP compiler deprecated. 
And can be removed in future.

And, ThriftClassLoader can also be removed in future, to migrate composer 
autoloader.


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-01-30 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user RobberPhex commented on the issue:

https://github.com/apache/thrift/pull/1479
  
There are some break changes:

1. for generated code, old struct is `Types.php` for all args, results, 
`.php` for `ServiceIf`, `ServiceClient`, etc.
  new struct is `.php` for ``. 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', '')` or 
`$thriftLoader->registerNamespace('namespace', '')`.
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: 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)


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-01-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


Github user jeking3 commented on the issue:

https://github.com/apache/thrift/pull/1479
  
Are these changes all backwards compatible?


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


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-01-24 Thread Robert Lu (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-4474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (THRIFT-4474) PHP generator use PSR-4 default

2018-01-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on THRIFT-4474:


GitHub user RobberPhex opened a pull request:

https://github.com/apache/thrift/pull/1479

THRIFT-4474: generate PHP code use PSR-4 style default

ref: https://issues.apache.org/jira/browse/THRIFT-4474

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/RobberPhex/thrift default-psr4

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/thrift/pull/1479.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1479


commit a083deebd3977f68bf5fdfe1d2e88ea240f8183a
Author: Robert Lu 
Date:   2018-01-17T11:40:39Z

generate PHP code use PSR-4 style default




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