prodrigestivill/gravatar
Composer 安装命令:
composer require prodrigestivill/gravatar
包简介
Fetch avatar image on view e-mail (using Gravatar and/or custom API).
README 文档
README
Non official plug-in showing Gravatar profile images inside the Roundcube webmail client, it also supports custom avatars API.
It has been implemented as Roundcube readonly hidden addressbook. You have to ensure this plugin is added into the latest entry in the main config ($config['plugins']). If so and any address book (LDAP, Google, etc...) already has a photo for a contact it will use first the other pictures and lastly if none reported it will use gravatar (Roundcube will use it in following the order listed in the main config).
Tested in roundcube 1.7.0.
Installation
Intallation steps:
- Via composer:
- Run
php composer.phar require "prodrigestivill/gravatar":"dev-master"
- Run
- Via git:
- Clone the repository:
cd roundcube/plugins && git clone git@github.com:prodrigestivill/roundcube-gravatar.git gravatar
- Clone the repository:
- Via tarball:
- Download and extract the tarball into
roundcube/pluginsdirectory and rename the extracted directory togravatar
- Download and extract the tarball into
For the expected behaviour ensure it is always the latest plugin (or at least addressbook plugin) in the $config['plugins'] list at config/config.inc.php.
Also consider cleaning the browser cache when changing from disabled to enabled or vice versa.
To enable per user: Login to Roundcube and enable/disable plugin by navigating to the Settings page, clicking on Preferences, click on Address Book, and Enable Gravatar, and Save.
To configure/change default values:
- Copy
config.inc.php.disttoconfig.inc.phpinplugins/gravatar/directory. - Modify the values you are interested into change and comment the rest with '//'
Custom API
You can define your custom API for photos at 'gravatar_custom_photo_api' in config.inc.php in plugins/gravatar/ directory. With the following substitutions.
- %%: literal '%'
- %s: schema ('http', 'https') depending of 'gravatar_https' config
- %e: contact email (escaped with urlencode)
- %m: hashed md5(email)
- %a: hashed sha1(email)
- %z: configured avatar size (in px)
- %r: configured rating ('g', 'pg', 'r', 'x')
Usage for default Gravatar API is: %s://www.gravatar.com/avatar/%m?s=%z&r=%r&d=404
You can use local files, it is not needed to be an URL. But if you plan to use it for direct filesystem access, for security reasons it is best to only use hashed email substitutions, even that all parameters are escaped with urlencode.
Examples:
$config['gravatar_custom_photo_api'] = 'http://www.example.com/directory/%e.jpg?s=%z'; //OR// $config['gravatar_custom_photo_api'] = '/path/%m.jpg';
prodrigestivill/gravatar 适用场景与选型建议
prodrigestivill/gravatar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.32k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2020 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「gravatar」 「avatar」 「photo」 「addressbook」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 prodrigestivill/gravatar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 prodrigestivill/gravatar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 prodrigestivill/gravatar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A library providing easy gravatar integration/generation (Laravel supported).
Generate an Adorable Avatar for Laravel
Library to validate and parse social media profile URLs
Glance project service for managing user photos
Creates a basic photo gallery pagetype with albums and photos. Photos within albums are opened with a lightbox.
Change the default avatar url provider with one for inline SVGs
统计信息
- 总下载量: 2.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2020-04-13