Download the PHP package gravatarphp/gravatar without Composer
On this page you can find all versions of the php package gravatarphp/gravatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gravatarphp/gravatar
More information about gravatarphp/gravatar
Files in gravatarphp/gravatar
Package gravatar
Short Description Gravatar URL builder which is most commonly called as a Gravatar library
License MIT
Homepage http://gravatarphp.com
Informations about the package gravatar
Gravatar
Gravatar URL builder (aka. a Gravatar library)
Install
Via Composer
Usage
Create a Gravatar
instance and use it for creating URLs.
You can override the globally used protocol (HTTP, HTTPS) by setting the last parameter to true/false.
Last, but not least, you can pass default options to the builder and use them to generate avatar URLs.
Parameters
If you pass any of the following parameters and turn validation on (fourth parameter in the avatar()
method), their values will be checked against the allowed values defined in the Gravatar documentation:
s
,size
-- The image sized
,default
-- The default image to display if there is no matching Gravatarf
,forcedefault
-- Tell Gravatar to use the default image even if there is a matching Gravatarr
,rating
-- The audience rating (G
,R
, etc.) to restrict the Gravatar to
If the value fails validation, an InvalidArgumentException
will be thrown.
Any parameters not listed above are not sanitized or validated in anyway.
Notes
Profile, vCard and QR Code requests will only work with the primary email address. This is a limitation of Gravatar. However the builder won't complain, since it doesn't know if it is your primary address or not. For more tips and details check the Gravatar documentation.
Testing
License
The project is licensed under the MIT License.