PHPackages                             arthurhoaro/favicon - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. arthurhoaro/favicon

ActiveLibrary[File &amp; Storage](/categories/file-storage)

arthurhoaro/favicon
===================

PHP Library used to discover favicon from given URL

v2.0.1(1y ago)36737.4k↑36.9%7[3 issues](https://github.com/ArthurHoaro/favicon/issues)[1 PRs](https://github.com/ArthurHoaro/favicon/pulls)Apache-2.0PHPPHP ^8.0

Since Oct 14Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ArthurHoaro/favicon)[ Packagist](https://packagist.org/packages/arthurhoaro/favicon)[ Docs](https://github.com/ArthurHoaro/favicon)[ RSS](/packages/arthurhoaro-favicon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

A library to determine a site's favicon
=======================================

[](#a-library-to-determine-a-sites-favicon)

This library is based on [Chris Shiflett work](https://github.com/shiflett/favicon).

Here are the changes you can see in this version:

- Cover more use case to find favicons
- Composer support
- Various technical changes and improvements
- Unit tests

Requirements
------------

[](#requirements)

- [PHP 8.0+](http://php.net/) (you can use v1.x for PHP 5.6+)
- [php-xml](http://php.net/manual/fr/refs.xml.php) extension: parse HTML content
- [php-fileinfo](http://php.net/manual/fr/book.fileinfo.php) extension: check image type

Composer
--------

[](#composer)

Use [Composer](https://getcomposer.org) by adding the following lines in your `composer.json`:

```
"require": {
    "arthurhoaro/favicon": "~2.0"
}

```

Basic Usage
-----------

[](#basic-usage)

```
require_once('vendor/autoload.php');

$favicon = new \Favicon\Favicon();

echo $favicon->get('http://hoa.ro');
// Displays: http://hoa.ro/themes/hoaro/img/favicon.png
var_dump($favicon->get('http://nofavicon.tld', FaviconDLType::HOTLINK_URL));
// Returns false
```

You can avoid hotlinking by downloading the favicons:

```
$favicon = new \Favicon\Favicon();

// return the generated filename inside the cache folder
$favicon->get('http://hoa.ro', FaviconDLType::DL_FILE_PATH);
// return false
$favicon->get('http://nofavicon.tld');
```

Or directly get the raw image as a binary string:

```
$favicon = new \Favicon\Favicon();

// return the binary string of the downloaded favicon
$favicon->get('http://hoa.ro', FaviconDLType::RAW_IMAGE);
// return false
$favicon->get('http://nofavicon.tld');
```

> Note: `DL_FILE_PATH` and `RAW_IMAGE` require the cache to be enabled.

Configure
---------

[](#configure)

You can setup cache settings:

```
$favicon = new Favicon();
$settings = array(
    // Cache directory
    'dir' => '/tmp/',
    // Cache timeout in seconds
    'timeout' => 86400,
    // Default image when no favicon is found
    'defaultico' => 'img/fav.ico'
);
$favicon->cache($settings);
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 71.3% 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 ~305 days

Recently: every ~339 days

Total

13

Last Release

572d ago

Major Versions

v1.3.4 → v2.0.02023-10-22

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.3

v1.3.0PHP &gt;=5.6

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c10a2db899f8a62f26beb418c0ea969ae714921b8e39bef7145f046cacd18f9?d=identicon)[ArthurHoaro](/maintainers/ArthurHoaro)

---

Top Contributors

[![ArthurHoaro](https://avatars.githubusercontent.com/u/1962678?v=4)](https://github.com/ArthurHoaro "ArthurHoaro (57 commits)")[![Alkarex](https://avatars.githubusercontent.com/u/1008324?v=4)](https://github.com/Alkarex "Alkarex (10 commits)")[![shiflett](https://avatars.githubusercontent.com/u/67555?v=4)](https://github.com/shiflett "shiflett (6 commits)")[![ChristophWurst](https://avatars.githubusercontent.com/u/1374172?v=4)](https://github.com/ChristophWurst "ChristophWurst (3 commits)")[![SMillerDev](https://avatars.githubusercontent.com/u/1484494?v=4)](https://github.com/SMillerDev "SMillerDev (1 commits)")[![cetcondor](https://avatars.githubusercontent.com/u/40753639?v=4)](https://github.com/cetcondor "cetcondor (1 commits)")[![ilpianista](https://avatars.githubusercontent.com/u/529436?v=4)](https://github.com/ilpianista "ilpianista (1 commits)")[![kitbs](https://avatars.githubusercontent.com/u/4569320?v=4)](https://github.com/kitbs "kitbs (1 commits)")

---

Tags

finderfaviconicon

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/arthurhoaro-favicon/health.svg)

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

###  Alternatives

[mpclarkson/icon-scraper

PHP Library to get the apple-touch-icons and favicon from a website.

2129.2k](/packages/mpclarkson-icon-scraper)[yosymfony/resource-watcher

A simple resource watcher using Symfony Finder

698.2M22](/packages/yosymfony-resource-watcher)[dmhendricks/file-icon-vectors

A collection of file type icons in SVG format.

35774.8k6](/packages/dmhendricks-file-icon-vectors)[ergebnis/classy

Provides collectors for classy constructs (classes, enums, interfaces, and traits).

382.8M20](/packages/ergebnis-classy)[edsdk/flmngr-server-php

Flmngr file manager PHP backend

20279.5k3](/packages/edsdk-flmngr-server-php)[samsonasik/array-lookup

A fast lookup library that help you verify and search array and Traversable data

2863.0k2](/packages/samsonasik-array-lookup)

PHPackages © 2026

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