The Google API Core for PHP, popularly known as google/gax, is a collection of modules that simplifies the development of APIs for clients based on Google API conventions and gRPC. This facilitates developers when interacting with Google API, by using services like page streaming and retry mechanisms to provide a more user-friendly and idiomatic API interface.
Utilizing google/gax in your PHP project can be done using the following steps:
cd ~/
sudo apt-get install php php-dev libcurl3-openssl-dev php-pear php-bcmath php-xml
curl -sS https://getcomposer.org/installer | php
sudo pecl install protobuf
cd /path/to/gax-php
cp ~/composer.phar ./
php composer.phar install
vendor/bin/phpunit --bootstrap tests/bootstrap.php tests
If you change composer.json
, update the dependencies with this command:
php composer.phar update
To format your source code, use:
vendor/bin/phpcbf -s --standard=./ruleset.xml
and:
vendor/bin/phpcs -s --standard=./ruleset.xml
Usually, application code does not directly use most classes within google/gax. This library mostly aids code generated automatically from Google API's definition files.
google/gax's fully detailed and updated documentation can be found at https://googleapis.github.io/gax-php. Users are encouraged to consult this resource for deeper understanding and utilization of google/gax.