Comments (9)
There is no mention about this class because it's not needed π What's the exact issue you're dealing with?
from php-protobuf.
How to deserialize such a message, can you please give an example?
from php-protobuf.
Take a look at Usage.
from php-protobuf.
Your hints and clues won't work because I am not a PHP programmer. Usage doesn't show the nested case I am asking about.
Please tell me how to create such a PHP object and serialize it. How to deserialize it. How to include multiple php files generated.
from php-protobuf.
The only difference the nested case implies is different class name, nothing more. Please find an example for your case but it doesn't show much more than the Usage section.
require_once 'Foo_Sub.php';
$fooSub = new \Foo_Sub();
$fooSub->setId(1);
$fooSub->setAgeSec(2);
$packed = $fooSub->serializeToString();
$unpackedSubFoo = new \Foo_Sub();
$unpackedSubFoo->parseFromString($packed);
$unpackedSubFoo->dump();
from php-protobuf.
This I was able to do before. But don't we need to add $fooSub to $foo somehow? Like shouldn't there be addSub function in Foo?
So that we get a single packed string. When I receive a packed string how do i differentiate?
from php-protobuf.
You don't have a field of type Sub in Foo message..
from php-protobuf.
Yes.. But shouldn't there be? The example you gave simply deals with Foo_Sub.
Not the entire Foo. How to do that?
from php-protobuf.
No, you don't need to define a field of nested type, it's up to you but basically you define nested messages to use them in a parent message.
from php-protobuf.
Related Issues (20)
- How to generate the CodeGeneratorResponse.php file? HOT 2
- How to define namespace using protoc?
- Error while installation, step 3 Build and install the PHP extension. HOT 2
- ERROR: The protoc command in your system is too old. Minimum required version is 2.6.0 but found 2.5.0 HOT 1
- Does this extension have a Windows version HOT 1
- make: *** [protobuf.lo] Error 1 HOT 7
- 64-bit integers on x86 HOT 2
- Can it be encoded as a binary stream? HOT 1
- Why change null to another value? HOT 4
- read Protocol Buffers delimited HOT 2
- ERROR: Unable to find the protoc command. Please make sure it's installed and available in the path. HOT 1
- ERROR: protobuf module is not installed. --allegrophp_out: protoc-gen-allegrophp: Plugin failed with status code 1. HOT 5
- Does php-protobuf support extend HOT 1
- Add support for extensions
- --allegrophp_out: protoc-gen-allegrophp: Plugin failed with status code 127. HOT 10
- How do we send request and receive response with this? HOT 1
- Can't be compiled for > PHP 7 on Windows 7 x64 HOT 4
- one question --php_out: protoc-gen-php: Plugin output is unparseable: This is a stub file for IDEs, don't use it directly! HOT 1
- php8.0 ηΌθ―δΈζε HOT 1
- Macbook m1 chip php5.6.31 wrong HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-protobuf.