PHPackages                             php-feed-io/favicon-io - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-feed-io/favicon-io

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-feed-io/favicon-io
======================

PHP library for fetching favicons

v1.0.0(1mo ago)01.1k↓31.3%MITPHPPHP &gt;=8.2CI passing

Since May 3Pushed 5d ago1 watchersCompare

[ Source](https://github.com/php-feed-io/favicon-io)[ Packagist](https://packagist.org/packages/php-feed-io/favicon-io)[ RSS](/packages/php-feed-io-favicon-io/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (3)Used By (0)

favicon-io
==========

[](#favicon-io)

[![Packagist](https://camo.githubusercontent.com/91625018b224ba615e7fcecf161429d22b57132d371fb19e4f546adb0329d8f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d666565642d696f2f66617669636f6e2d696f2e737667)](https://packagist.org/packages/php-feed-io/favicon-io)

A PHP library for discovering favicons from websites, built on [PSR-18 (HTTP Client)](https://www.php-fig.org/psr/psr-18/).

Features
--------

[](#features)

- **Priority-ordered discovery**: apple-touch-icon → sized icons (largest first, SVG preferred) → regular icon → `/favicon.ico` → `og:image`
- **PSR-18 / PSR-17 compatible** — plug any HTTP client (Guzzle, Symfony, etc.)
- **Optional PSR-16 caching** — avoid re-probing the same domain on every call
- **Optional PSR-3 logging** — debug-level messages for HTTP failures
- **No framework dependencies**

Installation
------------

[](#installation)

```
composer require php-feed-io/favicon-io
```

You also need a PSR-18 HTTP client and PSR-17 request factory. For example, using [Nyholm/psr7](https://github.com/Nyholm/psr7) and [Symfony HTTP Client](https://symfony.com/doc/current/http_client.html):

```
composer require nyholm/psr7 symfony/http-client
```

Usage
-----

[](#usage)

```
use FeedIo\FaviconIo\FaviconDiscovery;
use Nyholm\Psr7\Factory\Psr17Factory;
use Symfony\Component\HttpClient\Psr18Client;

$psr17Factory = new Psr17Factory();
$httpClient   = new Psr18Client();

$discovery = new FaviconDiscovery(
    httpClient:     $httpClient,
    requestFactory: $psr17Factory,
);

$faviconUrl = $discovery->discover('https://example.com');
// Returns a URL string, or null if no favicon was found.
```

### With caching (PSR-16)

[](#with-caching-psr-16)

```
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;

$cache = new Psr16Cache(new FilesystemAdapter());

$discovery = new FaviconDiscovery(
    httpClient:     $httpClient,
    requestFactory: $psr17Factory,
    cache:          $cache,           // PSR-16 CacheInterface
    cacheTtl:       7 * 86400,        // seconds; default is 7 days
);
```

### With logging (PSR-3)

[](#with-logging-psr-3)

```
$discovery = new FaviconDiscovery(
    httpClient:     $httpClient,
    requestFactory: $psr17Factory,
    logger:         $psrLogger,       // PSR-3 LoggerInterface
);
```

Discovery priority
------------------

[](#discovery-priority)

PrioritySource1`` / ``2`` — largest dimension wins; SVG preferred on tie; `sizes="any"` counts as scalable3`` / `` — without `sizes` attribute4`/favicon.ico` — confirmed via HEAD request (2xx required)5`` — last resortRequirements
------------

[](#requirements)

- PHP 8.2+
- PSR-18 HTTP client implementation
- PSR-17 request factory implementation

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance96

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

37d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aca071a681d47c00f8f5b9d2b83a6af64b8046f13d141430bc2c4537c20f77c5?d=identicon)[Grotax](/maintainers/Grotax)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![SMillerDev](https://avatars.githubusercontent.com/u/1484494?v=4)](https://github.com/SMillerDev "SMillerDev (6 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")[![Grotax](https://avatars.githubusercontent.com/u/5429298?v=4)](https://github.com/Grotax "Grotax (2 commits)")

---

Tags

faviconiconfetch

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/php-feed-io-favicon-io/health.svg)

```
[![Health](https://phpackages.com/badges/php-feed-io-favicon-io/health.svg)](https://phpackages.com/packages/php-feed-io-favicon-io)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

84735.1k](/packages/flow-php-flow)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

744284.3k34](/packages/civicrm-civicrm-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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