wentthefox / services_libravatar
API interfacing class for libravatar.org
v1.0.5
2026-10-05 05:26 UTC
Requires
- php: >=8.4
Requires (Dev)
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^7 || ^8
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A PHP 8.4+ library to the Libravatar service that delivers avatar pictures to other websites: It gives you image URLs for email addresses.
Forked from https://github.com/pear/Services_Libravatar
Installation
Via Composer:
$ composer require wentthefox/services_libravatar
Usage
<?php require 'vendor/autoload.php'; use PEAR\Services\Libravatar; $emailOrHash = 'test@example.com'; # OR $emailOrHash = '55502f40dc8b7c769880b10874abc9d0'; $service = new Libravatar(); $service->setHttps(true); $service->setSize(128); echo $service->getUrl($emailOrHash); # https://seccdn.libravatar.org/avatar/55502f40dc8b7c769880b10874abc9d0?size=128
Additional documentation available at the original source. Most methods signatures are identical.