PHPackages                             gravityrd/php7-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gravityrd/php7-client

ActiveLibrary[API Development](/categories/api)

gravityrd/php7-client
=====================

PHP client to access Gravity R&amp;D

022.9k↓50%1PHP

Since Jul 5Pushed 7y ago7 watchersCompare

[ Source](https://github.com/gravityrd/php7-client)[ Packagist](https://packagist.org/packages/gravityrd/php7-client)[ RSS](/packages/gravityrd-php7-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

GravityClient
=============

[](#gravityclient)

This is the PHP 7 + version of the former GravityClient. The project adheres to PSR (1,2,4,7) standards, as a result the return values of the Client methods now return a PSR7 compliant response.

Installation and Usage
----------------------

[](#installation-and-usage)

- Use Composer to install the package (refer to the git project for now)
- The library needs a concrete PSR7 MessageFactory and a HTTPlug Client implementation for Client abstraction. These dependencies must come from your project. The HTTPlug project already offers ready made Clients and adapters for the most common http use cases (curl, socket, Guzzle etc) for more info consult the [docs](http://docs.php-http.org/en/latest/index.html).
- For the impatient see the Samples for a Curl and Guzzle based "hello world" example

UPGRADE FROM 1.X Gravityrd client
---------------------------------

[](#upgrade-from-1x-gravityrd-client)

- You must provide a PSR7 MessageFactory and a HTTPlug Client implementation along. You can either simply require those in your composer project or pass to the client explicitly.
    - Client implementations:
    - Message Factory implementations:
    - Or you can make your own, check the HTTPlug documentation for interface definitions
- Exception Handling:
    - The GravityException is no more. The Client will throw if configuration or initialization fails the proper sub component exception.
    - When making Requests the HTTPlug Exceptions will be thrown, see: [docs](http://docs.php-http.org/en/latest/httplug/exceptions.html?highlight=exceptions)
- Currently we only support synchronous clients which will always return with a PSR7 Request (the exact classes depend on the Message Factory you proviced).
    - However you can still pass the async flag to the request that will behave exactly as 1.X used to.
- Client Configuration:
    - Gravity Config now only takes care of the Gravity specific settings, client specific settings such as the old: verifyPeer are now must be done in the Client that you use (so in this case you must inject your client) see the example bellow:

    ```
    // The Message and Stream factories will be
    // dicovered in this case, and you only pass options.
    // For the options available see the Client's documentation

    $options = [
      CURLOPT_CONNECTTIMEOUT => 10,
      CURLOPT_SSL_VERIFYPEER => false
    ];

    $curlClient = new Http\Client\Curl\Client(null,null,$options);
    ```

    The removed config options are:
    - timeoutSeconds
    - verifyPeer
    - verbose

    - Client Configuration became immutable, you must use the constructor to set it

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1157f85802de6d67b37c288b836e15058c82b9f1c0bd0d16e59c675a7c7cd8f6?d=identicon)[dozsy](/maintainers/dozsy)

![](https://www.gravatar.com/avatar/11564b518952fca54dc4f26db0632e0752bb4b3e3f8146b8cfc3b4182c69ea1a?d=identicon)[gravityDani](/maintainers/gravityDani)

---

Top Contributors

[![targetingHackaton](https://avatars.githubusercontent.com/u/43088773?v=4)](https://github.com/targetingHackaton "targetingHackaton (5 commits)")[![frdani](https://avatars.githubusercontent.com/u/7465227?v=4)](https://github.com/frdani "frdani (3 commits)")[![alexbumbacea](https://avatars.githubusercontent.com/u/724634?v=4)](https://github.com/alexbumbacea "alexbumbacea (1 commits)")[![dozsy](https://avatars.githubusercontent.com/u/711807?v=4)](https://github.com/dozsy "dozsy (1 commits)")

### Embed Badge

![Health badge](/badges/gravityrd-php7-client/health.svg)

```
[![Health](https://phpackages.com/badges/gravityrd-php7-client/health.svg)](https://phpackages.com/packages/gravityrd-php7-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
