承接 vincepare/favicon-downloader 相关项目开发

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

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

vincepare/favicon-downloader

Composer 安装命令:

composer require vincepare/favicon-downloader

包简介

Find & download favicons

README 文档

README

FaviconDownloader can find favicon URL (and download it) from a web page URL. This PHP class handles multiple favicons flavors, including some edge cases like relative URL or embed favicons :

  • Absolute URL :
    <link rel="shortcut icon" href="http://www.domain.com/images/fav.ico" />
  • Absolute URL with relative scheme :
    <link rel="shortcut icon" href="//www.domain.com/images/fav.ico" />
  • Absolute path :
    <link rel="shortcut icon" href="/images/fav.ico" />
  • Relative URL :
    <link rel="shortcut icon" href="../images/fav.ico" />
  • Embed base64-encoded favicon :
    <link rel="icon" type="image/x-icon" href="data:image/x-icon;base64,AAABAAEAE ... /wAA//8AAA==" />

Install

The easiest way to install FaviconDownloader is to use Composer from the command line :

composer require vincepare/favicon-downloader

Otherwise, just download FaviconDownloader.php and require it manually. Tested on PHP 5.3, 5.4, 5.5 & 5.6.

Example

require 'FaviconDownloader.php';
use Vincepare\FaviconDownloader\FaviconDownloader;

// Find & download favicon
$favicon = new FaviconDownloader('http://stackoverflow.com/questions/19503326/bug-with-chrome-tabs-create-in-a-loop');

if (!$favicon->icoExists) {
    echo "No favicon for ".$favicon->url;
    die(1);
}

echo "Favicon found : ".$favicon->icoUrl."\n";

// Saving favicon to file
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'favicon-'.time().'.'.$favicon->icoType;
file_put_contents($filename, $favicon->icoData);
echo "Saved to ".$filename."\n\n";

echo "Details :\n";
$favicon->debug();

统计信息

  • 总下载量: 432
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 15
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2015-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固