Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

google/protobuf v4.26.0RC1

proto library for PHP
Package summary
Share
0
issues
0
licenses
Package created
24 Sep 2016
Version published
25 Jan 2024
Maintainers
1
Total deps
0
Direct deps
0
License
BSD-3-Clause
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does google/protobuf do?

Google/Protobuf is a PHP library that allows for the use of Google's Protocol Buffers, a language-neutral, platform-neutral, extensible mechanism for serializing structured data. The library supports Composer installation and is a part of Google's broader Protocol Buffers project.

How do you use google/protobuf?

To use Google/Protobuf, you will need to install it via Composer. You can do it by running the following command in your project root:

composer require google/protobuf

Once the library is installed, you can use it within your PHP files as follows:

<?php
require_once 'vendor/autoload.php';  
$message = new Tutorial\Person();  
$message->setName("John Doe");  
$message->setId(1);  
$serialized = $message->serializeToString();  

$newMessage = new Tutorial\Person();
$newMessage->mergeFromString($serialized);  

echo $newMessage->getName();  // Prints "John Doe"
?>

Please note that you need to have the Protobuf extension for PHP installed and enabled for this to work. The exact usage may vary depending on the nature of your structured data and the Protocol Buffers schema you design.

Where are the google/protobuf docs?

The documentation for the Google/Protobuf PHP library can be found as a part of the main Protocol Buffers project on GitHub, located at https://github.com/protocolbuffers/protobuf/tree/master/php. Detailed instructions for installation, usage, and other guidance can be found there. Any support requests, bug reports, or development contributions for the PHP library should also be directed to the main Protocol Buffers project on GitHub.