PHP 클래스 Horde_Service_Gravatar, horde

저자: Gunnar Wrobel ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $base = self::STANDARD, Horde_Http_Client $client = null ) Constructor.
fetchAvatar ( string $mail, mixed $opts = [] ) : resource Fetch the avatar image.
fetchProfile ( string $mail ) : string Fetch the Gravatar profile information.
getAvatarUrl ( string $mail, mixed $opts = [] ) : Horde_Url Return the Gravatar image URL for the specified mail address. The returned URL can be directly used with an IMG tag e.g.: <img src="http://www.gravatar.com/avatar/hash" />
getId ( string $mail ) : string Return the Gravatar ID for the specified mail address.
getProfile ( string $mail ) : array Return the Gravatar profile information as an array.
getProfileUrl ( string $mail ) : string Return the Gravatar profile URL.

메소드 상세

__construct() 공개 메소드

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.
public __construct ( string $base = self::STANDARD, Horde_Http_Client $client = null )
$base string The base Gravatar URL.
$client Horde_Http_Client The HTTP client to access the server.

fetchAvatar() 공개 메소드

Fetch the avatar image.
public fetchAvatar ( string $mail, mixed $opts = [] ) : resource
$mail string The mail address.
$opts mixed Additional options. See getAvatarUrl().
리턴 resource The image as stream resource, or null if the server returned an error.

fetchProfile() 공개 메소드

Fetch the Gravatar profile information.
public fetchProfile ( string $mail ) : string
$mail string The mail address.
리턴 string The profile information.

getAvatarUrl() 공개 메소드

Return the Gravatar image URL for the specified mail address. The returned URL can be directly used with an IMG tag e.g.: <img src="http://www.gravatar.com/avatar/hash" />
public getAvatarUrl ( string $mail, mixed $opts = [] ) : Horde_Url
$mail string The mail address.
$opts mixed Additional options. If an integer, treated as the 'size' option. If an array, the following options are available:
  - default: (string) Default behavior. Valid values are '404', 'mm',
             'identicon', 'monsterid', 'wavatar', 'retro', 'blank', or
             a URL-encoded URL to use as the default image.
  - rating: (string) Rating. Valid values are 'g', 'pg', 'r', and 'x'.
  - size: (integer) Image size. Valid values are between 1 and 512.
리턴 Horde_Url The image URL.

getId() 공개 메소드

Return the Gravatar ID for the specified mail address.
public getId ( string $mail ) : string
$mail string The mail address.
리턴 string The Gravatar ID.

getProfile() 공개 메소드

Return the Gravatar profile information as an array.
public getProfile ( string $mail ) : array
$mail string The mail address.
리턴 array The profile information.

getProfileUrl() 공개 메소드

Return the Gravatar profile URL.
public getProfileUrl ( string $mail ) : string
$mail string The mail address.
리턴 string The profile URL.