PHP Library used to discover favicon from given URL
PHP
Pull request Compare This branch is 19 commits ahead of shiflett:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
resources
src/Favicon
tests/Favicon
.gitignore
LICENSE
README.md
VERSION
composer.json

README.md

A library to determine a site's favicon

This library is based on Chris Shiflett work.

Here are the changes you can see in this version:

  • Cover more use case to find favicons
  • Various technical changes and improvements
  • Composer support
  • Unit tests
  • Not found favicon now return false (default action isn't this lib responsability)

Requirements

Composer

Use Composer by adding the following lines in your composer.json:

"require": {
    "arthurhoaro/favicon": "dev-master"
},

Usage

<?php

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'));
// Returns false