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

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

softwarevamp/shortstop
======================

Fast and flexible HTTP client for PHP 5.2+

2.0.2(12y ago)017MPL-2.0PHPPHP &gt;=5.2

Since Sep 16Pushed 12y agoCompare

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

READMEChangelogDependencies (6)Versions (9)Used By (0)

shortstop [![Build Status](https://camo.githubusercontent.com/4dafed3950d80d420d28678d5d609487409a16e3e3c086526573f7144c39e368/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f65686f7567682f73686f727473746f702e706e67)](http://travis-ci.org/ehough/shortstop)
==========================================================================================================================================================================================================================================================================

[](#shortstop-)

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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

4684d 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/7d485f9b314c340286960760ee99e033c6a9fdcf2b085bb2d8182755ab08ef7e?d=identicon)[softwarevamp](/maintainers/softwarevamp)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
