PHPackages                             ehough/shortstop - 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. ehough/shortstop

AbandonedArchivedLibrary

ehough/shortstop
================

Fast and flexible HTTP client for PHP 5.2+

2.0.2(12y ago)14582[1 issues](https://github.com/ehough/shortstop/issues)[1 PRs](https://github.com/ehough/shortstop/pulls)1MPL-2.0PHPPHP &gt;=5.2

Since Sep 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ehough/shortstop)[ Packagist](https://packagist.org/packages/ehough/shortstop)[ Docs](https://github.com/ehough/shortstop)[ RSS](/packages/ehough-shortstop/feed)WikiDiscussions develop Synced 6d ago

READMEChangelog (2)Dependencies (6)Versions (9)Used By (1)

shortstop
---------

[](#shortstop)

[![Build Status](https://camo.githubusercontent.com/4dafed3950d80d420d28678d5d609487409a16e3e3c086526573f7144c39e368/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f65686f7567682f73686f727473746f702e706e67)](http://travis-ci.org/ehough/shortstop)[![Project Status: Unsupported - The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.](https://camo.githubusercontent.com/baae56ff2a4e564adcf10fe13a639b7e4aaf1d62054fd5086a2e570ecc3637e5/687474703a2f2f7777772e7265706f7374617475732e6f72672f6261646765732f6c61746573742f756e737570706f727465642e737667)](http://www.repostatus.org/#unsupported)[![Latest Stable Version](https://camo.githubusercontent.com/094c62b00e748ac3ad3594827e0996d6be22a51736d719a64243403c41505658/68747470733a2f2f706f7365722e707567782e6f72672f65686f7567682f73686f727473746f702f762f737461626c65)](https://packagist.org/packages/ehough/shortstop)[![License](https://camo.githubusercontent.com/fcaf1d9e06cb1c51b6f3bd9095dc45e91f381d0c387d002f0644d050a5f108c3/68747470733a2f2f706f7365722e707567782e6f72672f65686f7567682f73686f727473746f702f6c6963656e7365)](https://packagist.org/packages/ehough/shortstop)

**This library is no longer maintained.** Fast and flexible HTTP client for PHP 5.2+.

### Motivation

[](#motivation)

Today we can choose from a number of excellent HTTP client libraries for PHP. However, they all assume a particular configuration of the underlying PHP installation. e.g. [Guzzle](http://guzzlephp.org/) requires [cURL](http://php.net/manual/en/book.curl.php). This presents a problem if you want to ship code that can be run on an arbitrary PHP server.

`shortstop` mitigates this problem by dynamically selecting the best underlying HTTP mechanism for the server's environment. As a result, `shortstop` works on virtually any PHP 5.2+ installation.

### Features

[](#features)

- Compatible with PHP 5.2+
- Supports [cURL](http://php.net/manual/en/book.curl.php), PHP's [HTTP extension](http://php.net/manual/en/book.http.php), [fsockopen()](http://php.net/manual/en/function.fsockopen.php), [fopen()](http://php.net/manual/en/function.fopen.php), and [streams](http://www.php.net/manual/en/book.stream.php)
- HTTP 1.0 only (for now!)
- Strong support for HTTP content compression. Exact mechanism (deflate, gzip, etc) determined by server environment
- Built-in chunked-transfer decoding
- Highly configurable and extensible via an [event dispatcher compatible with Symfony's event dispatcher](https://github.com/ehough/tickertape)
- Heavily tested with excellent code coverage

### Usage

[](#usage)

As you can see below, the trade-off for all the flexibility of `stash` is that assembling the components can be quite verbose. Using an inversion-of-control container can help, as the actual client can be reused as a singleton. If, however, you'd like to use `stash` on its own then you can follow the code below.

```
//build an event dispatcher
$eventDispatcher = new ehough_tickertape_EventDispatcher();  //implements ehough_tickertape_EventDispatcherInterface

//build an HTTP message parser
$httpMessageParser = new ehough_shortstop_impl_exec_DefaultHttpMessageParser();

//build a chain of HTTP transport mechanisms
$chain = new ehough_chaingang_impl_StandardChain();
$chain->addCommand(new ehough_shortstop_impl_exec_command_CurlCommand($httpMessageParser, $eventDispatcher));
$chain->addCommand(new ehough_shortstop_impl_exec_command_ExtCommand($httpMessageParser, $eventDispatcher));
$chain->addCommand(new ehough_shortstop_impl_exec_command_FopenCommand($httpMessageParser, $eventDispatcher));
$chain->addCommand(new ehough_shortstop_impl_exec_command_FsockOpenCommand($httpMessageParser, $eventDispatcher));
$chain->addCommand(new ehough_shortstop_impl_exec_command_StreamsCommand($httpMessageParser, $eventDispatcher));

//build the HTTP client
$client = new ehough_shortstop_impl_DefaultHttpClient($eventDispatcher, $chain);

//build a chain of HTTP content decoders
$contentDecodingChain = new ehough_chaingang_impl_StandardChain();
$contentDecodingChain->addCommand(new ehough_shortstop_impl_decoding_content_command_NativeGzipDecompressingCommand());
$contentDecodingChain->addCommand(new ehough_shortstop_impl_decoding_content_command_SimulatedGzipDecompressingCommand());
$contentDecodingChain->addCommand(new ehough_shortstop_impl_decoding_content_command_NativeDeflateRfc1950DecompressingCommand());
$contentDecodingChain->addCommand(new ehough_shortstop_impl_decoding_content_command_NativeDeflateRfc1951DecompressingCommand());

//build an HTTP content decoder
$httpContentDecoder = new ehough_shortstop_impl_decoding_content_HttpContentDecodingChain($contentDecodingChain);

//add some HTTP request listeners
$eventDispatcher->addListener(ehough_shortstop_api_Events::REQUEST,
    array(new ehough_shortstop_impl_listeners_request_RequestDefaultHeadersListener($httpContentDecoder), 'onPreRequest'));
$eventDispatcher->addListener(ehough_shortstop_api_Events::REQUEST,
    array(new ehough_shortstop_impl_listeners_request_RequestLoggingListener(), 'onPreRequest'));

//build a chain of HTTP transport decoders
$transferDecodingChain = new ehough_chaingang_impl_StandardChain();
$transferDecodingChain->addCommand(new ehough_shortstop_impl_decoding_transfer_command_ChunkedTransferDecodingCommand());

//build an HTTP transport decoder
$httpTransferDecoder = new ehough_shortstop_impl_decoding_transfer_HttpTransferDecodingChain($transferDecodingChain);

//add some HTTP response listeners
$eventDispatcher->addListener(ehough_shortstop_api_Events::RESPONSE,
    array(new ehough_shortstop_impl_listeners_response_ResponseDecodingListener($httpTransferDecoder, 'Transfer'), 'onResponse'));
$eventDispatcher->addListener(ehough_shortstop_api_Events::RESPONSE,
    array(new ehough_shortstop_impl_listeners_response_ResponseDecodingListener($httpContentDecoder, 'Content'), 'onResponse'));
$eventDispatcher->addListener(ehough_shortstop_api_Events::RESPONSE,
    array(new ehough_shortstop_impl_listeners_response_ResponseLoggingListener(), 'onResponse'));

//build a new HTTP request
$request = new ehough_shortstop_api_HttpRequest('GET', 'https://github.com/');

//execute the request
$response = $client->execute($request);

$status = $response->getStatusCode();    //e.g. 200

$entity = $response->getEntity();        // instance of ehough_shortstop_api_HttpEntity
$type   = $entity->getContentType();     // e.g. text/html
$body   = $entity->getContent();         // the actual body of the response
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~50 days

Recently: every ~64 days

Total

7

Last Release

4687d ago

Major Versions

1.0.3 → 2.0.02013-04-08

PHP version history (2 changes)1.0.0PHP &gt;=5.1.0

2.0.0PHP &gt;=5.2

### Community

Maintainers

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

---

Top Contributors

[![ehough](https://avatars.githubusercontent.com/u/369261?v=4)](https://github.com/ehough "ehough (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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