承接 arthurhoaro/favicon 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

arthurhoaro/favicon

最新稳定版本:v2.0.1

Composer 安装命令:

composer require arthurhoaro/favicon

包简介

PHP Library used to discover favicon from given URL

README 文档

README

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
  • Composer support
  • Various technical changes and improvements
  • Unit tests

Requirements

Composer

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

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

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

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

统计信息

  • 总下载量: 707.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 36
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 33
  • Watchers: 2
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固