PHPackages                             ehough/guzzle-commands - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ehough/guzzle-commands

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

ehough/guzzle-commands
======================

PHP 5.3-compatible fork of guzzle/command

v1.0.0(9y ago)161MITPHPPHP &gt;=5.3.29

Since Feb 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ehough/guzzle-commands)[ Packagist](https://packagist.org/packages/ehough/guzzle-commands)[ RSS](/packages/ehough-guzzle-commands/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

ehough/guzzle-commands
======================

[](#ehoughguzzle-commands)

[![Build Status](https://camo.githubusercontent.com/76311ec5567e3a07c336b29a44569525e72210c18ee1faedf8f1d052607109ed/68747470733a2f2f7472617669732d63692e6f72672f65686f7567682f67757a7a6c652d636f6d6d616e64732e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/ehough/guzzle-commands)[![Latest Stable Version](https://camo.githubusercontent.com/d95bf2546f6ee52f27a54032c2ac5a03a10215c3fea2128cad9ea3ddf1f76dc8/68747470733a2f2f706f7365722e707567782e6f72672f65686f7567682f67757a7a6c652d636f6d6d616e64732f762f737461626c65)](https://packagist.org/packages/ehough/guzzle-commands)[![License](https://camo.githubusercontent.com/a4d0bb5814140d12f7f0c196bef58bdbeb7b2c4e2c8e3d168cbfa6fca0ab5a5d/68747470733a2f2f706f7365722e707567782e6f72672f65686f7567682f67757a7a6c652d636f6d6d616e64732f6c6963656e7365)](https://packagist.org/packages/ehough/guzzle-commands)

A PHP 5.3-compatible fork of [Guzzle Commands](https://github.com/guzzle/command).

Why?
====

[](#why)

Sadly, [60%](https://w3techs.com/technologies/details/pl-php/5/all) of all PHP web servers still run PHP 5.4 and lower, but Guzzle Commands needs PHP 5.5 or higher. This fork makes Guzzle Commands compatible with PHP 5.3.29 through 7.1.

How to Use This Fork
====================

[](#how-to-use-this-fork)

Usage is identical to [`guzzle/command`](https://github.com/guzzle/command), except that the code in this library is namespaced under `Hough\Guzzle\Command` instead of `GuzzleHttp\Command`.

---

This library uses Guzzle (`ehough/guzzle`, version 6.x) and provides the foundations to create fully-featured web service clients by abstracting Guzzle HTTP **requests** and **responses** into higher-level **commands** and **results**. A **middleware** system, analogous to — but separate from — the one in the HTTP layer may be used to customize client behavior when preparing commands into requests and processing responses into results.

### Commands

[](#commands)

Key-value pair objects representing an operation of a web service. Commands have a name and a set of parameters.

### Results

[](#results)

Key-value pair objects representing the processed result of executing an operation of a web service.

Service Clients
---------------

[](#service-clients)

Service Clients are web service clients that implement the `Hough\Guzzle\Command\ServiceClientInterface` and use an underlying Guzzle HTTP client (`GuzzleHttp\Client`) to communicate with the service. Service clients create and execute **commands** (`Hough\Guzzle\Command\CommandInterface`), which encapsulate operations within the web service, including the operation name and parameters. This library provides a generic implementation of a service client: the `Hough\Guzzle\Command\ServiceClient` class.

Instantiating a Service Client
------------------------------

[](#instantiating-a-service-client)

@TODO Add documentation

- `ServiceClient`'s constructor
- Transformer functions (`$commandToRequestTransformer` and `$responseToResultTransformer`)
- The `HandlerStack`

Executing Commands
------------------

[](#executing-commands)

Service clients create command objects using the `getCommand()` method.

```
$commandName = 'foo';
$arguments = ['baz' => 'bar'];
$command = $client->getCommand($commandName, $arguments);
```

After creating a command, you may execute the command using the `execute()`method of the client.

```
$result = $client->execute($command);
```

The result of executing a command will be a `Hough\Guzzle\Command\ResultInterface`object. Result objects are `ArrayAccess`-ible and contain the data parsed from HTTP response.

Service clients have magic methods that act as shortcuts to executing commands by name without having to create the `Command` object in a separate step before executing it.

```
$result = $client->foo(['baz' => 'bar']);
```

Asynchronous Commands
---------------------

[](#asynchronous-commands)

@TODO Add documentation

- `-Async` suffix for client methods
- Promises

```
// Create and execute an asynchronous command.
$command = $command = $client->getCommand('foo', ['baz' => 'bar']);
$promise = $client->executeAsync($command);

// Use asynchronous commands with magic methods.
$promise = $client->fooAsync(['baz' => 'bar']);
```

@TODO Add documentation

- `wait()`-ing on promises.

```
$result = $promise->wait();

echo $result['fizz']; //> 'buzz'
```

Concurrent Requests
-------------------

[](#concurrent-requests)

@TODO Add documentation

- `executeAll()`
- `executeAllAsync()`.
- Options (`fulfilled`, `rejected`, `concurrency`)

Middleware: Extending the Client
--------------------------------

[](#middleware-extending-the-client)

Middleware can be added to the service client or underlying HTTP client to implement additional behavior and customize the `Command`-to-`Result` and `Request`-to-`Response` lifecycles, respectively.

Todo
----

[](#todo)

- Middleware system and command vs request layers
- The `HandlerStack`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% 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.

###  Release Activity

Cadence

Every ~675 days

Total

2

Last Release

3428d ago

Major Versions

0.8.x-dev → v1.0.02016-12-23

PHP version history (2 changes)0.8.x-devPHP &gt;=5.4.0

v1.0.0PHP &gt;=5.3.29

### Community

Maintainers

![](https://www.gravatar.com/avatar/53b269d929f6ba572a15e4b069d9b59e0e99af74db1be60cbac7a56adfea9221?d=identicon)[ehough](/maintainers/ehough)

---

Top Contributors

[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (127 commits)")[![ehough](https://avatars.githubusercontent.com/u/369261?v=4)](https://github.com/ehough "ehough (10 commits)")[![jeremeamia](https://avatars.githubusercontent.com/u/107867?v=4)](https://github.com/jeremeamia "jeremeamia (9 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (9 commits)")[![Konafets](https://avatars.githubusercontent.com/u/363363?v=4)](https://github.com/Konafets "Konafets (2 commits)")[![seiffert](https://avatars.githubusercontent.com/u/1111118?v=4)](https://github.com/seiffert "seiffert (2 commits)")[![hpatoio](https://avatars.githubusercontent.com/u/249948?v=4)](https://github.com/hpatoio "hpatoio (1 commits)")[![elyobo](https://avatars.githubusercontent.com/u/407806?v=4)](https://github.com/elyobo "elyobo (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ehough-guzzle-commands/health.svg)

```
[![Health](https://phpackages.com/badges/ehough-guzzle-commands/health.svg)](https://phpackages.com/packages/ehough-guzzle-commands)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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