Overview

Packages

  • Service
    • Gravatar

Classes

  • Horde_Service_Gravatar
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Service_Gravatar

Horde_Service_Gravatar abstracts communication with Services supporting the Gravatar API (http://www.gravatar.com/site/implement/).

Copyright 2011-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Package: Service\Gravatar
Category: Horde
License: LGPL 2.1
Author: Gunnar Wrobel wrobel@pardus.de
Link: http://pear.horde.org/index.php?package=Service_Gravatar
Located at Horde/Service/Gravatar.php
Methods summary
public
# __construct( string $base = Horde_Service_Gravatar::STANDARD, Horde_Http_Client $client = null )

Constructor.

Constructor.

The default Gravatar base URL is Horde_Service_Gravatar::STANDARD. If you need URLs in an HTTPS context you should provide the base URL parameter as Horde_Service_Gravatar::SECURE. In case you wish to access another URL offering the Gravatar API you can specify the base URL of this service as $base.

Parameters

$base
The base Gravatar URL.
$client
The HTTP client to access the server.
public string
# getId( string $mail )

Return the Gravatar ID for the specified mail address.

Return the Gravatar ID for the specified mail address.

Parameters

$mail
The mail address.

Returns

string
The Gravatar ID.

Throws

InvalidArgumentException
In case the mail address is no string.
public string
# getAvatarUrl( string $mail, integer $size = null )

Return the Gravatar image URL for the specified mail address. The returned URL can be directly used with an tag e.g.

Return the Gravatar image URL for the specified mail address. The returned URL can be directly used with an tag e.g.

Parameters

$mail
The mail address.
$size
<p>An optinoal size parameter. Valid values are between 1 and 512.</p>

Returns

string
The image URL.

Throws

InvalidArgumentException
In case the mail address is no string.
public string
# getProfileUrl( string $mail )

Return the Gravatar profile URL.

Return the Gravatar profile URL.

Parameters

$mail
The mail address.

Returns

string
The profile URL.

Throws

InvalidArgumentException
In case the mail address is no string.
public string
# fetchProfile( string $mail )

Fetch the Gravatar profile information.

Fetch the Gravatar profile information.

Parameters

$mail
The mail address.

Returns

string
The profile information.

Throws

InvalidArgumentException
In case the mail address is no string.
public array
# getProfile( string $mail )

Return the Gravatar profile information as an array.

Return the Gravatar profile information as an array.

Parameters

$mail
The mail address.

Returns

array
The profile information.

Throws

InvalidArgumentException
In case the mail address is no string.
public resource
# fetchAvatar( string $mail, integer $size = null )

Fetch the avatar image.

Fetch the avatar image.

Parameters

$mail
The mail address.
$size
An optional size parameter.

Returns

resource
The image as stream resource.

Throws

InvalidArgumentException
In case the mail address is no string.
Constants summary
string STANDARD

The default Gravatar base URL

The default Gravatar base URL

# 'http://www.gravatar.com'
string SECURE

The Gravatar base URL in SSL context

The Gravatar base URL in SSL context

# 'https://secure.gravatar.com'
API documentation generated by ApiGen