Class YahooSession

Description

Defines a session between an application and the Yahoo! platform.

Defines a session between an application and the Yahoo! platform.

Located in /Yahoo.inc (line 222)


	
			
Variable Summary
 mixed $accessToken
 mixed $application
 mixed $client
 mixed $consumer
 mixed $guid
Method Summary
 YahooSession YahooSession ( $consumer,  $accessToken,  $applicationId)
 void accessTokenExpired ( $accessToken,  $consumer,  $applicationId,  $sessionStore)
 boolean checkSession ( &$sessionType,  $sessionStore)
 void clearSession ([$sessionStore $sessionStore = NULL])
 stdclass createAuthorizationUrl ($consumerKey $consumerKey, $consumerSecret $consumerSecret, [$callback $callback = NULL], [$sessionStore $sessionStore = NULL])
 void getAccessToken ()
 void getConsumer ()
 YahooUser getUser ($guid $guid)
 boolean hasSession ($consumerKey $consumerKey, $consumerSecret $consumerSecret, [$applicationId $applicationId = NULL], [$sessionStore $sessionStore = NULL], [ $verifier = NULL])
 void initSession ( $consumerKey,  $consumerSecret,  $applicationId,  $redirect,  $callback,  $sessionStore,  $verifier)
 void initSessionFromYAP ( $consumerKey,  $consumerSecret,  $appid)
 The query ($yql $yql, [$env $env = NULL])
 void redirectForAuthorization ( $consumerKey,  $consumerSecret, [ $callback = NULL], [ $sessionStore = NULL])
 YahooSession requireSession ($consumerKey $consumerKey, $consumerSecret $consumerSecret, [$applicationId $applicationId = NULL], [$callback $callback = NULL], [$sessionStore $sessionStore = NULL], [$verifier $verifier = NULL])
Variables
mixed $accessToken = NULL (line 236)
  • private:
mixed $application = NULL (line 251)
  • private:
mixed $applicationId = NULL (line 241)
  • private:
mixed $client = NULL (line 246)
  • private:
mixed $consumer = NULL (line 231)
  • private:
mixed $guid = NULL (line 226)
  • private:
Methods
Constructor YahooSession (line 256)
  • private:
YahooSession YahooSession ( $consumer,  $accessToken,  $applicationId)
  • $consumer
  • $accessToken
  • $applicationId
accessTokenExpired (line 657)
  • private:
void accessTokenExpired ( $accessToken,  $consumer,  $applicationId,  $sessionStore)
  • $accessToken
  • $consumer
  • $applicationId
  • $sessionStore
checkSession (line 706)
  • return: True if a session is present, false otherwise.
  • private: Checks to see if the current PHP page request has a session and, if so, indicates what type of session is present.
boolean checkSession ( &$sessionType,  $sessionStore)
  • &$sessionType
  • $sessionStore
clearSession (line 361)

Destroys the current session, effectively logging out the current user.

Destroys the current session, effectively logging out the current user.

void clearSession ([$sessionStore $sessionStore = NULL])
  • $sessionStore $sessionStore: The session store implementation to clear. See YahooSessionStore for more information. If no session store is provided, clearSession will instantiate a NativeSessionStore and use that.
createAuthorizationUrl (line 464)

Creates authorization URLs, allowing applications to manage their user experience when the user needs to be sent to Yahoo! to authorize the application to access their account.

Creates authorization URLs, allowing applications to manage their user experience when the user needs to be sent to Yahoo! to authorize the application to access their account.

  • return: A PHP object with two properties: "urlWithCallback" and "urlWithoutCallback". This allows the application to mix and match authorizations that do and don't have callbacks in the URLs. urlWithoutCallback is useful for JavaScript popup windows while urlWithCallback is useful for normal <a href> tags.
stdclass createAuthorizationUrl ($consumerKey $consumerKey, $consumerSecret $consumerSecret, [$callback $callback = NULL], [$sessionStore $sessionStore = NULL])
  • $consumerKey $consumerKey: The OAuth consumer key.
  • $consumerSecret $consumerSecret: The OAuth consumer key secret.
  • $callback $callback: The callback URL to redirect the user to after they verify the application access. If no callback is provided, the current page URL will be used. Use the "oob" callback for desktop clients or for web clients where no callback should be used.
  • $sessionStore $sessionStore: The session store implementation to use. See YahooSessionStore for more information. If no session store is provided, createAuthorizationUrl will instantiate a NativeSessionStore and use that.
getAccessToken (line 279)
  • private:
void getAccessToken ()
getApplicationId (line 286)
  • private:
void getApplicationId ()
getConsumer (line 272)
  • private:
void getConsumer ()
getOwner (line 306)

Gets the user who owns the application install.

Gets the user who owns the application install. Only valid when viewed in YAP, otherwise will default to the logged-in user.

  • return: The currently sessioned YahooUser.
YahooUser getOwner ()
getSessionedUser (line 295)

Gets the currently sessioned user.

Gets the currently sessioned user.

  • return: The currently sessioned YahooUser.
YahooUser getSessionedUser ()
getUser (line 321)

Gets the user indicated by the GUID given.

Gets the user indicated by the GUID given.

  • return: The user indicated by the GUID given.
YahooUser getUser ($guid $guid)
  • $guid $guid: The GUID of the user to get.
hasSession (line 388)

Checks to see if there is a session in this PHP page request.

Checks to see if there is a session in this PHP page request. Doesn't cause any redirects for the user to log in, for that you should call requireSession().

  • return: True if a session is present, false otherwise.
boolean hasSession ($consumerKey $consumerKey, $consumerSecret $consumerSecret, [$applicationId $applicationId = NULL], [$sessionStore $sessionStore = NULL], [ $verifier = NULL])
  • $consumerKey $consumerKey: The OAuth consumer key.
  • $consumerSecret $consumerSecret: The OAuth consumer key secret.
  • $applicationId $applicationId: The application ID, optional.
  • $sessionStore $sessionStore: The session store implementation to use. See YahooSessionStore for more information. If no session store is provided, clearSession will instantiate a NativeSessionStore and use that.
  • $verifier
initSession (line 543)
  • private:
void initSession ( $consumerKey,  $consumerSecret,  $applicationId,  $redirect,  $callback,  $sessionStore,  $verifier)
  • $consumerKey
  • $consumerSecret
  • $applicationId
  • $redirect
  • $callback
  • $sessionStore
  • $verifier
initSessionFromYAP (line 495)
void initSessionFromYAP ( $consumerKey,  $consumerSecret,  $appid)
  • $consumerKey
  • $consumerSecret
  • $appid
query (line 332)

Executes the given YQL query.

Executes the given YQL query.

  • return: response or NULL if the request fails..
The query ($yql $yql, [$env $env = NULL])
  • $yql $yql: The query to execute.
  • $env $env: A URL to a YQL environment file.
redirectForAuthorization (line 339)
  • private:
void redirectForAuthorization ( $consumerKey,  $consumerSecret, [ $callback = NULL], [ $sessionStore = NULL])
  • $consumerKey
  • $consumerSecret
  • $callback
  • $sessionStore
requireSession (line 426)

Requires that there be a session in this PHP page request. a redirect for the user to log in, if necessary. requireSession() before any data is sent back to the user in order for the redirect to work.

Requires that there be a session in this PHP page request. Generates a redirect for the user to log in, if necessary. You must call requireSession() before any data is sent back to the user in order for the redirect to work.

  • return: The current session or NULL if a session cannot be established.
YahooSession requireSession ($consumerKey $consumerKey, $consumerSecret $consumerSecret, [$applicationId $applicationId = NULL], [$callback $callback = NULL], [$sessionStore $sessionStore = NULL], [$verifier $verifier = NULL])
  • $consumerKey $consumerKey: The OAuth consumer key.
  • $consumerSecret $consumerSecret: The OAuth consumer key secret.
  • $applicationId $applicationId: The application ID, optional.
  • $callback $callback: The callback URL to redirect the user to after they verify the application access. If no callback is provided, the current page URL will be used.
  • $sessionStore $sessionStore: The session store implementation to use. See YahooSessionStore for more information. If no session store is provided, clearSession will instantiate a NativeSessionStore and use that.
  • $verifier $verifier: The oauth_verifier returned by the OAuth servers after authorization. Passing NULL indicates that authorization was completed previously or that requireSession() should look for oauth_verifier in the $_GET superglobal.

Documentation generated on Thu, 22 Oct 2009 12:54:52 -0700 by phpDocumentor 1.4.3