Permalink
Browse files

Replace emberlabs/gravatarlib with forxer/gravatar

  • Loading branch information...
1 parent c2507b6 commit 5436d79d5e56095cb8c48de27b8cf6c8851baa85 @Vrtak-CZ Vrtak-CZ committed Feb 27, 2014
Showing with 47 additions and 65 deletions.
  1. +2 −6 app/config/config.neon
  2. +5 −6 app/view/HelperLoader.php
  3. +2 −3 composer.json
  4. +38 −50 composer.lock
View
@@ -16,7 +16,7 @@ parameters:
ghApiVersion: beta
ghClientId: null
ghClientSecret: null
-
+ gravatarMaxRating: pg
nette:
application:
@@ -58,11 +58,7 @@ services:
setup:
- addProcessor(@NetteAddons\TextProcessors\TexyProcessor, NetteAddons\TextPreprocessor::FORMAT_TEXY)
- addProcessor(@NetteAddons\TextProcessors\MarkdownProcessor, NetteAddons\TextPreprocessor::FORMAT_MARKDOWN)
- gravatar:
- class: emberlabs\GravatarLib\Gravatar
- setup:
- - setMaxRating(pg)
- helperLoader: NetteAddons\HelperLoader(@textPreprocessor, @gravatar)
+ helperLoader: NetteAddons\HelperLoader(@textPreprocessor, %gravatarMaxRating%)
# tables
users: NetteAddons\Model\Users
View
@@ -2,7 +2,7 @@
namespace NetteAddons;
-use emberlabs\GravatarLib\Gravatar;
+use forxer\Gravatar\Gravatar;
/**
@@ -16,15 +16,14 @@ class HelperLoader extends \Nette\Object
/**
* @param TextPreprocessor
- * @param \emberlabs\GravatarLib\Gravatar
+ * @param string
*/
- public function __construct(TextPreprocessor $preprocessor, Gravatar $gravatar)
+ public function __construct(TextPreprocessor $preprocessor, $gravatarMaxRating)
{
$this->helpers['description'] = array($preprocessor, 'processDescription');
$this->helpers['licenses'] = array($preprocessor, 'processLicenses');
- $this->helpers['gravatar'] = function($email, $size = 40) use($gravatar) {
- $gravatar->setAvatarSize($size);
- return $gravatar->buildGravatarURL($email);
+ $this->helpers['gravatar'] = function($email, $size = 40) use($gravatarMaxRating) {
+ return html_entity_decode(Gravatar::image($email, $size, null, $gravatarMaxRating));
};
$this->helpers['profile'] = function($id) {
return 'http://forum.nette.org/cs/profile.php?id=' . $id;
View
@@ -25,7 +25,7 @@
"kukulich/fshl": "~2.1.0",
"michelf/php-markdown": "~1.4.0",
"ezyang/htmlpurifier": "~4.6.0",
- "emberlabs/gravatarlib": "@dev"
+ "forxer/gravatar": "~1.1.2"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "dev-master#cf94fd4",
@@ -34,7 +34,6 @@
"nextras/migrations": "~2.1"
},
"autoload": {
- "files": ["app/misc/functions.php"],
- "classmap": ["libs/emberlabs/gravatarlib/emberlabs/gravatarlib/Gravatar.php"]
+ "files": ["app/misc/functions.php"]
}
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 5436d79

Please sign in to comment.