PHP 클래스 Hybrid_Provider_Model

Basically, each provider adapter has to define at least 4 methods: Hybrid_Providers_{provider_name}::initialize() Hybrid_Providers_{provider_name}::loginBegin() Hybrid_Providers_{provider_name}::loginFinish() Hybrid_Providers_{provider_name}::getUserProfile() HybridAuth also come with three others models Class Hybrid_Provider_Model_OpenID for providers that uses the OpenID 1 and 2 protocol. Class Hybrid_Provider_Model_OAuth1 for providers that uses the OAuth 1 protocol. Class Hybrid_Provider_Model_OAuth2 for providers that uses the OAuth 2 protocol.
파일 보기 프로젝트 열기: hybridauth/hybridauth 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$api stdClass The provider api client (optional)
$compressed stdClass Model should use "gzip,deflate" for CURLOPT_ENCODING
$config array Specific provider adapter config
$endpoint string Endpoint URL for that provider
$params array Provider extra parameters
$providerId mixed IDp ID (or unique name)
$useSafeUrls boolean Enable this to replace '.' with '_' characters in the callback urls
$user Hybrid_User Hybrid_User obj, represents the current loggedin user

공개 메소드들

메소드 설명
__construct ( mixed $providerId, array $config, array $params = null ) Common providers adapter constructor
clearTokens ( ) : void Clear all existent tokens for this provider
deleteToken ( $token ) : void Delete a stored token
getUserActivity ( $stream ) : Hybrid_User_Activity[] Return the user activity stream
getUserContacts ( ) : Hybrid_User_Contact[] Load the current logged in user contacts list from the IDp api client
getUserProfile ( ) : Hybrid_User_Profile Grab the user profile from the IDp api client
getUserStatus ( $statusid ) : mixed Return the user status
isUserConnected ( ) : boolean Return true if the user is connected to the current provider
logout ( ) : boolean Generic logout, just erase current provider adapter stored data to let Hybrid_Auth all forget about it
setUserConnected ( ) : void Set user to connected
setUserStatus ( $status ) : mixed Set user status
setUserUnconnected ( ) : void Set user to unconnected
token ( $token, $value = null ) : string Get or set a token

보호된 메소드들

메소드 설명
initialize ( ) : void IDp wrappers initializer
loginBegin ( ) : void Begin login
loginFinish ( ) : void Finish login

메소드 상세

__construct() 공개 메소드

Common providers adapter constructor
public __construct ( mixed $providerId, array $config, array $params = null )
$providerId mixed Provider ID
$config array Provider adapter config
$params array Provider extra params

clearTokens() 공개 메소드

Clear all existent tokens for this provider
public clearTokens ( ) : void
리턴 void

deleteToken() 공개 메소드

Delete a stored token
public deleteToken ( $token ) : void
리턴 void

getUserActivity() 공개 메소드

Return the user activity stream
public getUserActivity ( $stream ) : Hybrid_User_Activity[]
리턴 Hybrid_User_Activity[]

getUserContacts() 공개 메소드

Load the current logged in user contacts list from the IDp api client
public getUserContacts ( ) : Hybrid_User_Contact[]
리턴 Hybrid_User_Contact[]

getUserProfile() 공개 메소드

Grab the user profile from the IDp api client
public getUserProfile ( ) : Hybrid_User_Profile
리턴 Hybrid_User_Profile

getUserStatus() 공개 메소드

Return the user status
public getUserStatus ( $statusid ) : mixed
리턴 mixed Provider response

initialize() 추상적인 보호된 메소드

The main job of wrappers initializer is to performs (depend on the IDp api client it self): - include some libs needed by this provider, - check IDp key and secret, - set some needed parameters (stored in $this->params) by this IDp api client - create and setup an instance of the IDp api client on $this->api
abstract protected initialize ( ) : void
리턴 void

isUserConnected() 공개 메소드

Return true if the user is connected to the current provider
public isUserConnected ( ) : boolean
리턴 boolean

loginBegin() 추상적인 보호된 메소드

Begin login
abstract protected loginBegin ( ) : void
리턴 void

loginFinish() 추상적인 보호된 메소드

Finish login
abstract protected loginFinish ( ) : void
리턴 void

logout() 공개 메소드

Generic logout, just erase current provider adapter stored data to let Hybrid_Auth all forget about it
public logout ( ) : boolean
리턴 boolean

setUserConnected() 공개 메소드

Set user to connected
public setUserConnected ( ) : void
리턴 void

setUserStatus() 공개 메소드

Set user status
public setUserStatus ( $status ) : mixed
리턴 mixed Provider response

setUserUnconnected() 공개 메소드

Set user to unconnected
public setUserUnconnected ( ) : void
리턴 void

token() 공개 메소드

Get or set a token
public token ( $token, $value = null ) : string
리턴 string

프로퍼티 상세

$api 공개적으로 프로퍼티

The provider api client (optional)
public stdClass $api
리턴 stdClass

$compressed 공개적으로 프로퍼티

Model should use "gzip,deflate" for CURLOPT_ENCODING
public stdClass $compressed
리턴 stdClass

$config 공개적으로 프로퍼티

Specific provider adapter config
public array $config
리턴 array

$endpoint 공개적으로 프로퍼티

Endpoint URL for that provider
public string $endpoint
리턴 string

$params 공개적으로 프로퍼티

Provider extra parameters
public array $params
리턴 array

$providerId 공개적으로 프로퍼티

IDp ID (or unique name)
public mixed $providerId
리턴 mixed

$useSafeUrls 공개적으로 프로퍼티

Enable this to replace '.' with '_' characters in the callback urls
public bool $useSafeUrls
리턴 boolean

$user 공개적으로 프로퍼티

Hybrid_User obj, represents the current loggedin user
public Hybrid_User $user
리턴 Hybrid_User