Commit Graph

192 Commits

Author SHA1 Message Date
Joshua Haberman
585b24e9a6
Merge pull request #5032 from TeBoring/json-wrapper
Fix json parsing of wrapper values
2018-08-13 13:36:08 -07:00
Bo Yang
e3ee7167f1 Fix json parsing of wrapper values 2018-08-10 18:09:02 +00:00
Feng Xiao
a4862e790e Update generated descriptors. 2018-08-08 17:21:04 -07:00
johnlow95
e9a5412afc adding of hyperlink of the PHP (#4985) 2018-08-02 19:49:44 -07:00
Adam Cozzette
94d55e5292 Merge branch '3.6.x' into merge-3-6-x 2018-08-01 13:44:55 -07:00
Adam Cozzette
9e1286b949 Updated version numbers to 3.6.1 2018-07-27 13:30:28 -07:00
Timothy Younger
5134f1a340 Update Composer config in PHP module (#3829)
* Prevents installation of `phpunit/phpunit:^6` because the test cases in this project require `\PHPUnit_Framework_TestCase` which was removed in v6. Moves generated PHP classes for tests into autoload-dev so that they are not referenced in the dist autoload. Adds Composer scripts to run protoc with and without grpc.

* update composer test target to use the same commands as generate_php_test_proto in tests.sh
2018-07-23 13:33:23 -07:00
Leonard Hecker
e7746f487c php: Added nanosecond support for Timestamp (#3972)
* php: Added nanosecond support for Timestamp

* php: Fixed compatibility test
2018-07-20 13:03:00 -07:00
Paul Yang
fc90fd6df1
Make assertEquals pass for message (#4947)
This change only makes assertEquals pass for message in c extension. However, it actually does nothing.
This is the same behavior before 3.6.0 release.
2018-07-20 11:03:46 -07:00
Bo Yang
b23429ea32 Fix 32bit php tests 2018-07-15 21:01:48 -07:00
Bo Yang
8758cc1606 Fix php tests 2018-07-15 21:01:48 -07:00
Bo Yang
d779301670 Fix 32bit php tests 2018-07-13 09:10:16 +00:00
Bo Yang
51c188c2cc Fix php tests 2018-07-13 05:47:10 +00:00
Paul Yang
22503a0172
fix for API change in PHP 7.3 (#4898) 2018-07-12 12:34:18 -07:00
吕海涛
3beb19945b add JSON_UNESCAPED_UNICODE option (#4191) 2018-07-09 17:00:02 -07:00
Paul Yang
26eeec93e4
Enable ignoring unknown in json parsing in php (#4839)
* Enable ignoring unknown in json parsing in php

* Update generated descriptor files

* Update failure list for other languages.

* Remove unnecessary php files
2018-07-09 14:29:23 -07:00
Adam Cozzette
d6f346b4d5
Merge pull request #4827 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
2018-06-25 15:52:29 -07:00
Pat Moroney
d65d5821bc rename duplicate testMessageSetNullFail function (#3669)
the testMessageSetNullFail function was declared twice.
So I renamed one to testMessageSetNullFailMap
2018-06-25 14:57:40 -07:00
Vladimir Kovpak
7402555f34 Improved install command. (#4106)
Added `-y` flag to `sudo apt-get` command.
2018-06-25 14:20:21 -07:00
Adam Cozzette
82d3d7d250 Merge branch '3.6.x' into merge-3-6-x 2018-06-25 13:22:10 -07:00
Paul Yang
ce044817c7
Use legacy name in php runtime (#4741)
* Use legacy name in php runtime

Old generated code cannot work with new runtime, because the new runtime
assumes new class name for nested message. For details see #4738.

* Remove unused method
2018-06-07 18:16:44 -07:00
Paul Yang
d6353b489e
Update php version to 3.6.0 (#4736) 2018-06-06 19:04:25 -07:00
Paul Yang
5bf35ecca2 Fix php memory leak test (#4692) 2018-05-29 10:27:32 -07:00
Paul Yang
7d1a8fff1b
Fix php memory leak test (#4692) 2018-05-29 10:25:05 -07:00
Paul Yang
dadc95438f Fix array constructor in c extension for compatibility (#4667)
In old generated code, the constructor of message doesn't provide a
default null to parent's constructor. Previously, in c extesnion, this
case was not handled.
2018-05-25 13:04:29 -07:00
Brent Shaffer
2774e5441d PHP namespaces for nested messages and enums (#4536)
* uses namespaces for nested messages and enums

* fixes namespaces for PHP dist

* fixes namespace for Descriptors, adds Cardinality and Kind

* fixes nested namespaces for reserved words and adds tests

* adds tests and generator fix for php class prefixes

* fixes escaping of protobuf packages, enum comments, misc others

* nice refactor of generated code

* adds class files for backwards compatibility

* simplifies code with templates

* adds compatibility files to makefile

* cleanup of generator and fixes nested namespace bug

* regenerates proto types

* remove internal BC classes

* adds deprecated warning, adds methods back

* simplifies if statement

* fixes dist files

* addresses review comments

* adds back TYPE_URL_PREFIX constant

* adds @deprecated to old nested class files

* skips tests which require a separate process when protobuf.so is enabled

* Adds tests for legacy nested classes that do not require separate processes to test

* uses legacy names for GPBUtil message check

* adds block for IDE @deprecated message

* Namespace for nested message/enum in c extension

* Remove unused code
2018-05-25 13:04:19 -07:00
Bo Yang
8b336f8c5a Implement array constructor in php c extension. 2018-05-25 13:04:08 -07:00
Brent Shaffer
c9b404d23b PHP array constructors for protobuf messages (#4530)
* PHP array constructors for protobuf messages

* removes Descriptor from error message

* allows mergeFrom to accept an array

* only use initWithDescriptor if instanceof MapEntry

* adds doc comments

* removes ability for constructors to take arrays for submessages

* Revert "allows mergeFrom to accept an array"

This reverts commit b7b72182d5.

* makes mergeFromArray protected and fixes mergeFrom whitespace

* Separates merging from JSON and merging from PHP array

* removes well-known types and json keys from array construction

* Addresses PR review comments

* cleans up tests

* fixes exception messages
2018-05-25 13:03:58 -07:00
Paul Yang
d8483a92d7 Adopt php_metadata_namespace in php code generator (#4622)
* Adopt php_metadata_namespace in php code generator

The php_metadata_namespace is corresponded to the relative directory of
the metadata file. e.g., previously, the metadata file of foo.proto was
GPBMetadata/Foo.php. If the php_metadata_namespace is "Metadata\\Bar",
the metadata file will be Metadata/Bar/Foo.php.

* Handle empty php_metadata_namespace
2018-05-25 13:02:29 -07:00
Paul Yang
00d32539c6 Fix array constructor in c extension for compatibility (#4667)
In old generated code, the constructor of message doesn't provide a
default null to parent's constructor. Previously, in c extesnion, this
case was not handled.
2018-05-24 13:39:41 -07:00
Brent Shaffer
6737954661 PHP namespaces for nested messages and enums (#4536)
* uses namespaces for nested messages and enums

* fixes namespaces for PHP dist

* fixes namespace for Descriptors, adds Cardinality and Kind

* fixes nested namespaces for reserved words and adds tests

* adds tests and generator fix for php class prefixes

* fixes escaping of protobuf packages, enum comments, misc others

* nice refactor of generated code

* adds class files for backwards compatibility

* simplifies code with templates

* adds compatibility files to makefile

* cleanup of generator and fixes nested namespace bug

* regenerates proto types

* remove internal BC classes

* adds deprecated warning, adds methods back

* simplifies if statement

* fixes dist files

* addresses review comments

* adds back TYPE_URL_PREFIX constant

* adds @deprecated to old nested class files

* skips tests which require a separate process when protobuf.so is enabled

* Adds tests for legacy nested classes that do not require separate processes to test

* uses legacy names for GPBUtil message check

* adds block for IDE @deprecated message

* Namespace for nested message/enum in c extension

* Remove unused code
2018-05-24 13:39:41 -07:00
Bo Yang
839f71e305 Implement array constructor in php c extension. 2018-05-24 13:39:41 -07:00
Brent Shaffer
f1911f37f8 PHP array constructors for protobuf messages (#4530)
* PHP array constructors for protobuf messages

* removes Descriptor from error message

* allows mergeFrom to accept an array

* only use initWithDescriptor if instanceof MapEntry

* adds doc comments

* removes ability for constructors to take arrays for submessages

* Revert "allows mergeFrom to accept an array"

This reverts commit b7b72182d5.

* makes mergeFromArray protected and fixes mergeFrom whitespace

* Separates merging from JSON and merging from PHP array

* removes well-known types and json keys from array construction

* Addresses PR review comments

* cleans up tests

* fixes exception messages
2018-05-24 13:39:41 -07:00
Adam Cozzette
6ecc87666d Updated PHP generated code for timestamp.proto 2018-05-17 14:36:03 -07:00
Paul Yang
3d9e99b7e0
Adopt php_metadata_namespace in php code generator (#4622)
* Adopt php_metadata_namespace in php code generator

The php_metadata_namespace is corresponded to the relative directory of
the metadata file. e.g., previously, the metadata file of foo.proto was
GPBMetadata/Foo.php. If the php_metadata_namespace is "Metadata\\Bar",
the metadata file will be Metadata/Bar/Foo.php.

* Handle empty php_metadata_namespace
2018-05-14 16:08:47 -07:00
Paul Yang
b61dd9d9a2
Add file option php_metadata_namespace and ruby_package (#4609) 2018-05-11 13:57:06 -07:00
Paul Yang
7377d81ca4
Throw error if user want to access message properties (#4603)
* Throw error if user want to access message properties

* Fix typo
2018-05-10 10:52:39 -07:00
Paul Yang
5f7334f5f3
Avoid direct check of class name (#4601)
* Avoid direct check of class name

So that subclasses are also ok

* Use type hint in function signature.
2018-05-10 10:52:00 -07:00
Petar Dambovaliev
0869b1a0a7 Add space between class name and concat message (#4577)
The class name was linked to the next word in the sentence.
"User\UserRequestis not found in descriptor pool."
2018-04-30 11:00:46 -07:00
urfinjuezz
d7d863ea07 fix json_decode call parameters (#4381) 2018-04-09 14:14:31 -07:00
Brent Shaffer
13e627ad69 includes the expected class in the exception, otherwise the error is harder to track down (#3371) 2018-04-09 14:08:58 -07:00
Paul Yang
c931743461
Merge branch (#4466)
* Fix setup.py for windows build.

* Bump version number to 3.5.2

* Cat the test-suite.log on errors for presubits
2018-04-02 15:55:28 -07:00
Paul Yang
6dd563a674
Sync upb change (#4373) 2018-03-08 17:35:22 -08:00
Paul Yang
a48d58df96
Convert descriptortype to type for upb_msgval_sizeof (#4357) 2018-03-06 15:07:05 -08:00
Paul Yang
0f4ad85740
For encoding upb needs descriptor type instead of type. (#4354) 2018-03-06 13:30:03 -08:00
Adam Cozzette
5004d09ff0 PHP: fixed typo in message.c 2018-03-05 14:25:42 -08:00
Jisi Liu
bb40c0c0c4
Merge pull request #4291 from google/3.5.x
Merge 3.5.x to master
2018-02-26 10:05:09 -08:00
Paul Yang
51293f36d8
Fix more memory leak for php c extension (#4211)
* Fix more memory leak for php c extension

* Fix memory leak for php5.5
2018-01-25 11:31:05 -08:00
Paul Yang
3823897475
Well known types are not initialized properly. (#4139)
Previously, within the same load period of protobuf module, well known
types are not initialized correctly for the second request. The reason
is that well known type are only initialized if a method local static
variable is not set. However, that variable is not reset after request
ends. Therefore, when the second request comes, the method local static
variable is still set (by previous request) and well types are not
initialized in this case.
2018-01-05 13:05:07 -08:00
Jisi Liu
383a4941d5 Merge remote-tracking branch 'origin/3.5.x' into master 2018-01-03 09:28:40 -08:00