承接 luispabon/favicon-finder 相关项目开发

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

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

luispabon/favicon-finder

Composer 安装命令:

composer require luispabon/favicon-finder

包简介

PHP Library used to discover favicon from given URL

README 文档

README

Build status Code coverage

Favicon Finder

Simple PHP library to work out the favicon for a site, given an URL.

It currently supports finding the default favicon, if it exists on the host (eg /favicon.ico) as well as some basic HTML parsing of the homepage to hunt for standard favicon tags. Does not support apple type icons or manifests, although it can be extended to do so if necessary (PRs welcome).

This library is based on Arthur Hoaro's work.

Here are the changes you can see in this version:

  • Only return favicon paths, when found
  • PSR-16: Simple Cache support
  • More extensive HTML scraping tests
  • PHP 7.3+ support

Requirements

  • PHP 7.3
  • php-xml extension: parse HTML content
  • php-curl
  • Guzzle
  • GNU Make (or compatible): This is optional, if you want to contribute and use the Makefile targets available for running tests

Installation

composer req luispabon/favicon-finder

Basic usage

require_once('vendor/autoload.php');

$guzzle = new \GuzzleHttp\Client();

// You can use any PSR-16 implementation here - if you have none and don't care
// about caching, simply use the provided dummy cache implementation below
$cache = new \FaviconFinder\DummyCache();

// Cache lifetime in seconds (default is 86400 or 1 day)
$ttl = 60;

$favicon = new \FaviconFinder\Favicon($guzzle, $cache, $ttl);

echo $favicon->get('https://github.com/luispabon/favicon-finder');

// Displays: https://github.com/favicon.ico
var_dump($favicon->get('http://nofavicon.tld'));
// Returns null

Contributing

Fork this repo, do your stuff, send a PR. Tests are mandatory:

  • PHP unit coverage must be 100%
  • Infection MSI must be 100%
  • PHPStan must show no errors

The provided Makefile has all the basic test targets and is what's in use in CI.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-11-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固