Download the PHP package horde/service_gravatar without Composer
On this page you can find all versions of the php package horde/service_gravatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download horde/service_gravatar
More information about horde/service_gravatar
Files in horde/service_gravatar
Package service_gravatar
Short Description Gravatar client library
License LGPL-2.1-only
Homepage https://www.horde.org
Informations about the package service_gravatar
Horde Service_Gravatar
Modern PHP library for Gravatar profile and avatar services with native PSR-7/PSR-17/PSR-18 support.
Installation
Requirements
- PHP 8.1+
- PSR-18 HTTP client implementation
- PSR-17 HTTP factory implementation
Quick Start
Secure/HTTPS Mode
Architecture
This library provides two API levels for progressive disclosure:
Facade API
Simple string-based interface for basic usage:
Domain API
Rich value objects with detailed metadata:
Value Objects
Represents an email address with validation and Gravatar hash:
AvatarOptions
Immutable configuration for avatar requests:
Rating Enum
Content rating levels:
Rating::G- Suitable for all websitesRating::PG- May contain rude gestures, provocative dressRating::R- May contain profanity, intense violence, nudityRating::X- May contain hardcore sexual imagery
DefaultImage Enum
Default image options when avatar not found:
DefaultImage::NOT_FOUND- Return 404DefaultImage::MYSTERY_PERSON- Silhouette (mm)DefaultImage::IDENTICON- Geometric patternDefaultImage::MONSTERID- Generated monsterDefaultImage::WAVATAR- Generated faceDefaultImage::RETRO- 8-bit pixelated faceDefaultImage::BLANK- Transparent PNG
Or use a custom URL:
GravatarProfile
Parsed profile data with convenient accessors:
GravatarConfig
Service configuration:
Exception Handling
All exceptions extend GravatarException:
Examples
Get Avatar with Custom Default
Fetch Avatar Image
Check Profile Existence
Force Default Image
Advanced Usage
Custom HTTP Configuration
Multiple Avatars
Profile Social Accounts
Legacy Support
The PSR-0 lib/ directory provides backward compatibility wrappers for Horde 5 applications using Horde_Service_Gravatar. New code should use the modern Horde\Service\Gravatar namespace with native PSR interfaces.
See UPGRADING.md for migration instructions.
Testing
Test Coverage: 108 tests, 214 assertions
Documentation
- UPGRADING.md - Migration guide from Horde 5
- Gravatar API Documentation
- Horde Framework Documentation
License
LGPL 2.1 - See LICENSE file for details.
Contributing
Contributions are welcome! Please follow:
- PHP 8.1+ with strict types
- PER-1 coding style
- Comprehensive unit tests
- PHPUnit 12+ with attributes
- Conventional Commits for commit messages
Authors
- Gunnar Wrobel [email protected] - Original author
- Michael Slusarz - Lead maintainer
All versions of service_gravatar with dependencies
horde/http Version ^3 || dev-FRAMEWORK_6_0
horde/url Version ^3 || dev-FRAMEWORK_6_0