PHPackages                             mheap/silex-gravatar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mheap/silex-gravatar

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

mheap/silex-gravatar
====================

Gravatar extension for Silex

63.9k2PHP

Since Oct 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mheap/Silex-Gravatar)[ Packagist](https://packagist.org/packages/mheap/silex-gravatar)[ RSS](/packages/mheap-silex-gravatar/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (2)Used By (0)

Silex-Markdown
==============

[](#silex-markdown)

[![Build Status](https://camo.githubusercontent.com/e17ec8e41aab8a35f52befd6cf35d290f676b1dc65c317f31a5cb2596f6e7485/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d686561702f53696c65782d47726176617461722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/mheap/Silex-Gravatar)

### Requirements

[](#requirements)

This extension only works with *PHP 7.1+* and *Silex 2*. [Version 1.1.0](https://github.com/mheap/Silex-Gravater/releases/tag/1.1.0) is compatible with Silex 1.

### Installation

[](#installation)

Install with composer:

```
composer require mheap/silex-gravatar
```

### Usage

[](#usage)

First, you need to register the Gravatar extension. All of the options shown are optional.

```
$app->register(new SilexExtension\GravatarExtension(), array(
    'gravatar.cache_dir'  => sys_get_temp_dir() . '/gravatar',
    'gravatar.cache_ttl'  => 240, // 240 seconds
    'gravatar.options' => array(
        'size' => 100,
        'rating' => Gravatar\Service::RATING_G,
        'secure' => true,
        'default'   => Gravatar\Service::DEFAULT_404,
        'force_default' => true
    )
));
```

To fetch a Gravatar URL, use `$app['gravatar']`:

```
$app->get('/', function() use($app) {
    return $app['gravatar']->get('m@michaelheap.com');
});
```

If you're using Twig via `Silex\Provider\TwigServiceProvider()`, a `gravatar` function will be automatically registered for you. This allows you do do the following:

```
{% if gravatar_exist('m@michaelheap.com') %}
    Gravatar found
{% endif %}

```

### Available configuration options

[](#available-configuration-options)

The *GravatarExtension* provides access to the Gravatar web service through Sven Eisenschmidts's `Gravatar `\_ library.

- **gravatar.cache\_dir** (optional): A directory to cache the direct web service calls to gravatar.com
- **gravatar.cache\_ttl** (optional): The time how long a cache entry will live, defaults to 360 seconds
- **gravatar.options** (optional): An associative array of arguments for the [Gravatar\\Service class](https://github.com/sveneisenschmidt/gravatar-php/blob/master/src/Gravatar/Service.php#L84-L90)

### Running the tests

[](#running-the-tests)

There are no external dependencies for this library. Just `composer install` then run `./vendor/bin/phpunit`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfa28bbbb71524c79c7d87ad762c23e7a35dfc7216436a3ed6362cbdeda04299?d=identicon)[mheap](/maintainers/mheap)

---

Top Contributors

[![sveneisenschmidt](https://avatars.githubusercontent.com/u/62278?v=4)](https://github.com/sveneisenschmidt "sveneisenschmidt (39 commits)")[![mheap](https://avatars.githubusercontent.com/u/59130?v=4)](https://github.com/mheap "mheap (14 commits)")[![igorw](https://avatars.githubusercontent.com/u/88061?v=4)](https://github.com/igorw "igorw (5 commits)")[![korstiaan](https://avatars.githubusercontent.com/u/902842?v=4)](https://github.com/korstiaan "korstiaan (3 commits)")[![robo47](https://avatars.githubusercontent.com/u/110477?v=4)](https://github.com/robo47 "robo47 (3 commits)")[![jwpage](https://avatars.githubusercontent.com/u/52687?v=4)](https://github.com/jwpage "jwpage (2 commits)")[![KEIII](https://avatars.githubusercontent.com/u/1167833?v=4)](https://github.com/KEIII "KEIII (1 commits)")[![romainneutron](https://avatars.githubusercontent.com/u/137574?v=4)](https://github.com/romainneutron "romainneutron (1 commits)")

### Embed Badge

![Health badge](/badges/mheap-silex-gravatar/health.svg)

```
[![Health](https://phpackages.com/badges/mheap-silex-gravatar/health.svg)](https://phpackages.com/packages/mheap-silex-gravatar)
```

###  Alternatives

[motomedialab/simple-laravel-audit

A simple audit helper that integrates directly with Laravel &amp; FilamentPHP

262.7k](/packages/motomedialab-simple-laravel-audit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
