PHPackages                             balpom/universal-downloader - 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. balpom/universal-downloader

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

balpom/universal-downloader
===========================

Downloads the contents of the specified URI (or file).

v1.4.1(1y ago)0371MITPHPPHP &gt;=8.1

Since May 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/balpom/universal-downloader)[ Packagist](https://packagist.org/packages/balpom/universal-downloader)[ Docs](https://www.balpom.ru)[ RSS](/packages/balpom-universal-downloader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (1)

balpom/universal-downloader
===========================

[](#balpomuniversal-downloader)

Simple interfaces for content downloading on the specified URI (or file location) and it's trivial realisations.
----------------------------------------------------------------------------------------------------------------

[](#simple-interfaces-for-content-downloading-on-the-specified-uri-or-file-location-and-its-trivial-realisations)

This downloader will be useful for websites parsing, working with the REST API and other work with WEB resources via the HTTP protocol. This version of the package contains an interface implementation for use with any PSR-18 HTTP clients. It is planned to make an implementation that works through [Selenium WebDriver](https://github.com/php-webdriver/php-webdriver).

### Requirements

[](#requirements)

- **PHP &gt;= 8.1**

### Installation

[](#installation)

#### Using composer (recommended)

[](#using-composer-recommended)

```
composer require balpom/universal-downloader
```

### Simple downloader usage sample

[](#simple-downloader-usage-sample)

```
$downloader = new \Balpom\UniversalDownloader\SimpleDownloader();
$downloader = $downloader->get('https://ipmy.ru/ip');
echo $downloader->content() . PHP_EOL; // Must be your IP.
```

### PSR18 downloader usage sample

[](#psr18-downloader-usage-sample)

PSR18 downloader requires objects that implement the ResponseFactoryInterface, StreamFactoryInterface and UriFactoryInterface interfaces which defined in the [PSR-17 specification](https://www.php-fig.org/psr/psr-17/). An excellent library that implements all these interfaces at once (all-in-one) is [Nyholm/psr7](https://github.com/Nyholm/psr7) - will use it.

PSR18 downloader realisation also requires an HTTP client that implements the ClientInterface which defined in the [PSR-18 specification](https://www.php-fig.org/psr/psr-18/). For example, will use [phpwebclient/webclient](https://github.com/phpwebclient/webclient) and [guzzle/guzzle](https://github.com/guzzle/guzzle).

#### Installing third-party packages

[](#installing-third-party-packages)

```
composer require nyholm/psr7
```

```
composer require webclient/webclient
```

```
composer require guzzlehttp/guzzle
```

#### Downloader creation based on Webclient.

[](#downloader-creation-based-on-webclient)

```
$factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$client = new \Webclient\Http\Webclient($factory, $factory);
// Psr17Factories(RequestFactoryInterface $request, StreamFactoryInterface $stream, UriFactoryInterface $uri)
$factories = new \Balpom\UniversalDownloader\Factory\Psr17Factories($factory, $factory, $factory, $factory);
$downloader = new \Balpom\UniversalDownloader\Downloader($client, $factories);
```

#### Downloader creation based on GuzzleHttp.

[](#downloader-creation-based-on-guzzlehttp)

```
$client = new \GuzzleHttp\Client();
$factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$factories = new \Balpom\Downloader\Factory\Psr17Factories($factory, $factory, $factory, $factory);
// In my realisation Psr17Factory factories required.
// You may make your own realisation, bases on GuzzleHttp options (it has own Psr17Factory).
$downloader = new \Balpom\UniversalDownloader\Downloader($client, $factories);
```

#### Download URI

[](#download-uri)

For test purpose will make request to site .

```
$downloader = $downloader->get('http://ipmy.ru/ip');
$result = $downloader->result();
echo $result->code(); echo PHP_EOL; // Must be 200.
echo $result->content(); echo PHP_EOL; // Must be your IP.
echo $result->mime(); echo PHP_EOL; // Must be "text/html".
```

Extended sample you may find in "tests/test-psr18.php" file - just run it:

```
php tests/test-psr18.php
```

### License

[](#license)

MIT License See [LICENSE.MD](LICENSE.MD)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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 ~2 days

Total

7

Last Release

713d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5604ae7cc0bdc12fd8cf8867f3518ec3c9628f13707f127e700cdac1aec70b56?d=identicon)[balpom](/maintainers/balpom)

---

Top Contributors

[![balpom](https://avatars.githubusercontent.com/u/141855513?v=4)](https://github.com/balpom "balpom (18 commits)")

---

Tags

httpurlurihttpsclientwebhttp clientpsr-18filecontentdownloadsitedownloaderpsr18https-client

### Embed Badge

![Health badge](/badges/balpom-universal-downloader/health.svg)

```
[![Health](https://phpackages.com/badges/balpom-universal-downloader/health.svg)](https://phpackages.com/packages/balpom-universal-downloader)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[league/uri

URI manipulation library

1.1k206.4M277](/packages/league-uri)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

184616.9k31](/packages/laudis-neo4j-php-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[amphp/http-client-psr7

PSR-7 adapter for Amp's HTTP client.

1454.7k4](/packages/amphp-http-client-psr7)

PHPackages © 2026

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