This repository has been archived by the owner on Nov 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merged all documentation in to README.md * Renamed license file for Github auto-detect * Removed old vendors files * Added PHPCS for PSR-2 compliance * Added new tests for Twig provider * Added new tests for testing defaults
- Loading branch information
Showing
14 changed files
with
168 additions
and
2,043 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
vendor/ | ||
composer.phar | ||
composer.phar | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
language: php | ||
sudo: false | ||
|
||
before_script: composer install --dev --prefer-source | ||
before_script: composer install | ||
|
||
php: | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
|
||
matrix: | ||
allow_failures: | ||
- php: 7.0 | ||
- php: hhvm | ||
- 7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Copyright (c) 2011 Sven Eisenschmidt <[email protected]> | ||
Copyright (c) 2017 Michael Heap <[email protected]> | ||
Sven Eisenschmidt <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,68 @@ | ||
Silex-Gravatar | ||
================ | ||
# Silex-Markdown | ||
|
||
[![Build Status](https://secure.travis-ci.org/mheap/Silex-Gravatar.png?branch=master)](http://travis-ci.org/mheap/Silex-Gravatar) | ||
|
||
Installation | ||
------------ | ||
### Requirements | ||
|
||
Create a composer.json in your projects root-directory:: | ||
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. | ||
|
||
{ | ||
"require": { | ||
"mheap/Silex-Gravatar": "1.*" | ||
} | ||
} | ||
### Installation | ||
|
||
and run:: | ||
Install with composer: | ||
|
||
curl -s http://getcomposer.org/installer | php | ||
php composer.phar install | ||
```bash | ||
composer require mheap/silex-gravatar | ||
``` | ||
|
||
### Usage | ||
|
||
More Information | ||
---------------- | ||
First, you need to register the Gravatar extension. All of the options shown are optional. | ||
|
||
Read the documentation files under */doc*. | ||
```php | ||
$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 | ||
) | ||
)); | ||
``` | ||
|
||
License | ||
------- | ||
To fetch a Gravatar URL, use `$app['gravatar']`: | ||
|
||
'Silex-Gravatar' is licensed under the MIT license. | ||
```php | ||
$app->get('/', function() use($app) { | ||
return $app['gravatar']->get('[email protected]'); | ||
}); | ||
``` | ||
|
||
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: | ||
|
||
```twig | ||
{% if gravatar_exist('[email protected]') %} | ||
Gravatar found | ||
{% endif %} | ||
<img src="{{ gravatar('[email protected]', {'size': 50}) }}" /> | ||
``` | ||
|
||
### Available configuration options | ||
|
||
The *GravatarExtension* provides access to the Gravatar web service | ||
through Sven Eisenschmidts's `Gravatar <https://github.com/fate/Gravatar-php>`_ | ||
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 | ||
|
||
There are no external dependencies for this library. Just `composer install` then run `./vendor/bin/phpunit` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.