承接 ttree/identicons 相关项目开发

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

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

ttree/identicons

Composer 安装命令:

composer require ttree/identicons

包简介

Neos Flow package to generate identicons, based on Github or DonPark styles.

README 文档

README

This contains the Flow Framework package "Ttree.Identicons" to generate Identicons. Currently only two generators are available: Don Park (original version) and Github Style (inspired by the space invader style identicons provided by github).

Installation

  1. Just install and activate the package
  2. Include the package subroutes in your main Routes.yaml (optional: if you use only the fluid ViewHelper)
-
  name: 'Identicons'
  uriPattern: 'i/<IdenticonsSubroutes>'
  subRoutes:
        IdenticonsSubroutes:
          package: Ttree.Identicons

If you change the `uriPattern`, please read the section Flood Mitigation.

  1. Configure Imagine to use the `Imagick` drive. GD driver generate bad artifacts.
  2. Go to www.yourdomain/i/[yourhash].png (replace [yourhash] by any string)

This package is available on Packagist.org: https://packagist.org/packages/ttree/identicons

Settings

Setting Description Default Value
persist Enable persistance TRUE
size Default size (h/w) of the square icon 420
backgroundColor Default background color #EEE
ttl HTTP Cache header TTL in seconds 2592000
size Size constraints 32 / 2048
flood.enable Activate Flood mitigation TRUE
flood.limit Maximum number of request per minute 30
access.enable Enable advanced access limitation FALSE

Request Arguments

  • `s`: The size of the image, between 32 and 2048 pixels, (default: 420px)
  • `b`: The background color (default: transparent)

Flood Mitigation

By default this package limit the request rate per minute (for a single IP address) to 30 requests. You can change this in Settings.yaml. The flood mitigation use the caching framework to store request rate statistics, please change the default FileBackend for a production use.

Important: When an IP address is blocked, for a maximum of 1 minute, the Application Firewall block the request early in the Flow bootstrap (when a request arrive at the MVC dispatcher). If you don't use the default URL www.domain/i/hash.png, you need to change the patternValue in Settings.yaml, in the Flow Application Firewall section.

Advanced access limitation

By default this package will generate an identicons for any hash, if you need to limit this, per ex. you need to generate identicon only for existing Party, you can implement the interface AccessValidationInterface and enable access validation in the settings.

You also need to change the default implementation for this interface in your Objects.yaml (check the Objects.yaml from this package for the syntax).

Fluid ViewHelpers

You can insert an identicon in your Fluid template by using the provided ImageViewHelper.

{namespace identicon=Ttree\Identicons\ViewHelpers}
<identicon:image hash="ttree" alt="ttree -- identicon" size="42" class="img-polaroid" />

If the identicon doesn't exist for the provided hash, it will be created and persisted automatically.

Warning: Advanced Access Limitation and Flood Mitigation are not supported by the Fluid ViewHelper, you need to take care of your server by yourself.

Tips

You can write your own generator, just implement the GeneratorInterface and change the default implementation in your Objects.yaml (check the Objects.yaml from this package for the syntax).

Warning: if you change the Generator, currently you need to truncate the table "ttree_identicons_domain_model_identicon" manually.

Identicons Samples

Don Park Github Style

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固