Commit Graph

167 Commits

Author SHA1 Message Date
Bo Yang
8758cc1606 Fix php tests 2018-07-15 21:01:48 -07:00
Paul Yang
22503a0172
fix for API change in PHP 7.3 (#4898) 2018-07-12 12:34:18 -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
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
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
Paul Yang
c79ba5c1b6
Merge pull request #4034 from TeBoring/php-timestamp-bug
Avoid calling method from php extension directly
2017-12-15 10:36:07 -08:00
Bo Yang
8d6f13e86d Fix for php5.5 2017-12-14 13:24:00 -08:00
Bo Yang
39159c89f1 Accept DatetimeInterface in fromDatetime 2017-12-14 11:33:34 -08:00
Bo Yang
1a549d9a90 Avoid using php_date_get_date_ce() in case date extension is not
available.
2017-12-13 17:09:55 -08:00
Bo Yang
fffe8d39f8 Call php method via function name instead of calling directly.
This changes the linking error if php extension is not statically linked
to a runtime error. In this way, users who don't need Timestamp can
still use protobuf even if date extension is not statically linked in
php.
2017-12-12 17:47:04 -08:00
Paul Yang
f69a5db66f
Merge pull request #4028 from TeBoring/3.5.x
Add backslach to make class explict in global namespace
2017-12-12 14:28:27 -08:00
Bo Yang
88102eae8f Replace private timelib_update_ts with public date_timestamp_get 2017-12-12 13:57:49 -08:00
Bo Yang
9f6aceaa8c Add PROTOBUF_ENABLE_TIMESTAMP to let user decide whether timestamp util
can be used at install time.
2017-12-12 12:06:51 -08:00
Bo Yang
3b13c3f02e Add backslach to make class explict in global namespace 2017-12-11 15:44:27 -08:00
Bo Yang
fc5818b2bb Merge branch '3.5.0.1' into 3.5.x 2017-12-11 10:50:50 -08:00
Paul Yang
c370f88fb1
Recursively clear unknown fields in submessages. (#3982)
* Recursively clear unknown fields in submessages.

* Recursively discard unknown fields in submsg for c extension

* Fix zts build

* Add comment for tests

* Add a TODO to add a util for encoding varint for better readability.

* Add test for oneof message field.
2017-12-07 11:16:47 -08:00
Bo Yang
457f6a607c Add release log 2017-12-06 10:54:11 -08:00
Bo Yang
ba60b854b6 Update php c extension version number to 3.5.0.1 2017-12-06 10:46:57 -08:00
Bo Yang
212563d756 Fix memory leak in php7 2017-12-06 10:40:07 -08:00
Bo Yang
3b7a5f4515 Fix several more memory leak 2017-12-06 10:38:18 -08:00
Bo Yang
7d3437152a Fix memory leak when creating map field via array. 2017-12-06 10:37:53 -08:00
Bo Yang
e0d3aa057b Fix memory leak when creating repeated field via array. 2017-12-06 10:37:26 -08:00
Paul Yang
de44982a74 Remove duplicate typedef. (#3975) 2017-12-06 10:36:52 -08:00
Bo Yang
b140cb3145 Fix memory leak when creating map field via array. 2017-12-04 12:32:10 -08:00
Bo Yang
1acacf46cc Fix memory leak when creating repeated field via array. 2017-12-01 20:14:57 -08:00
Adam Cozzette
a27da09339 Merge branch '3.5.x' into 3.5.x-merge 2017-11-30 13:34:51 -08:00
Paul Yang
94bb1eed17
Remove duplicate typedef. (#3975) 2017-11-30 12:21:00 -08:00
Paul Yang
74e7decbbf
Provide discardUnknonwnFields API in php (#3976)
* Provide discardUnknownFields API in php implementation

* Provide discardUnknownFields API in php c extension.
2017-11-30 12:19:50 -08:00
Paul Yang
98836a56e6
Update version number for php c extension (#3896) 2017-11-15 17:17:36 -08:00
Paul Yang
857a021645
Use fully qualifed name for DescriptorPool in Any.php to avoid name (#3886)
conflict
2017-11-15 11:09:14 -08:00