2FAuth/app/Protobuf
Bubka f3166fded1 Update Protobuf README 2022-07-13 15:42:37 +02:00
..
GPBMetadata Update Protobuf classes 2022-07-06 17:21:37 +02:00
GoogleAuth Update Protobuf classes 2022-07-06 17:21:37 +02:00
GAuthValueMapping.php Refactoring - Move OTPHP logic to TwoFAccount model 2022-07-06 17:10:50 +02:00
GoogleAuth.proto Update Protobuf classes 2022-07-06 17:21:37 +02:00
README.md Update Protobuf README 2022-07-13 15:42:37 +02:00

README.md

Protobuf How To

⚠️ Protobuf classes are generated, do NOT modify the classes manually ⚠️

Setup

  • Install the protobuf compiler
sudo apt install protobuf-compiler
  • Install the protobuf PHP extension
sudo pecl install protobuf
  • Install the composer package
composer require google/protobuf

Reference: protobuf/php

Generate the class

  • Edit the *.proto file

Reference: protocol-buffers/docs/proto3

  • Run the following cli command:
protoc --proto_path=app/Protobuf/ --php_out=. app/Protobuf/GoogleAuth.proto

Protoc will generate the files in app/Protobuf while we want them to be in App/protobuf.

  • Moves the files from app/Protobuf to App/protobuf
  • Update the namespace of the moved files to match their new location

Reference: protocol-buffers/docs/php-generated