YahooSession Class Reference

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

List of all members.

Public Member Functions

 getSessionedUser ()
 getOwner ()
 getUser ($guid)
 query ($yql, $env=NULL)
 clearSession ($sessionStore=NULL)
 hasSession ($consumerKey, $consumerSecret, $applicationId=NULL, $sessionStore=NULL, $verifier=NULL)
 requireSession ($consumerKey, $consumerSecret, $applicationId=NULL, $callback=NULL, $sessionStore=NULL, $verifier=NULL)
 createAuthorizationUrl ($consumerKey, $consumerSecret, $callback=NULL, $sessionStore=NULL)
 initSessionFromYAP ($consumerKey, $consumerSecret, $appid)


Detailed Description

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

Member Function Documentation

YahooSession::clearSession ( sessionStore = NULL  ) 

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

Parameters:
$sessionStore The session store implementation to clear. See YahooSessionStore for more information. If no session store is provided, clearSession will instantiate a CookieSessionStore and use that.

YahooSession::createAuthorizationUrl ( consumerKey,
consumerSecret,
callback = NULL,
sessionStore = NULL 
)

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.

Parameters:
$consumerKey The OAuth consumer key.
$consumerSecret The OAuth consumer key secret.
$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 The session store implementation to use. See YahooSessionStore for more information. If no session store is provided, createAuthorizationUrl will instantiate a CookieSessionStore and use that.
Returns:
stdclass 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 tags.

YahooSession::getOwner (  ) 

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

Returns:
YahooUser The currently sessioned YahooUser.

YahooSession::getSessionedUser (  ) 

Gets the currently sessioned user.

Returns:
YahooUser The currently sessioned YahooUser.

YahooSession::getUser ( guid  ) 

Gets the user indicated by the GUID given.

Parameters:
$guid The GUID of the user to get.
Returns:
YahooUser The user indicated by the GUID given.

YahooSession::hasSession ( consumerKey,
consumerSecret,
applicationId = NULL,
sessionStore = NULL,
verifier = NULL 
)

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().

Parameters:
$consumerKey The OAuth consumer key.
$consumerSecret The OAuth consumer key secret.
$applicationId The application ID, optional.
$sessionStore The session store implementation to use. See YahooSessionStore for more information. If no session store is provided, clearSession will instantiate a CookieSessionStore and use that.
Returns:
boolean True if a session is present, false otherwise.

YahooSession::query ( yql,
env = NULL 
)

Executes the given YQL query.

Parameters:
$yql The query to execute.
$env A URL to a YQL environment file.
Returns:
The response or NULL if the request fails..

YahooSession::requireSession ( consumerKey,
consumerSecret,
applicationId = NULL,
callback = NULL,
sessionStore = NULL,
verifier = NULL 
)

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.

Parameters:
$consumerKey The OAuth consumer key.
$consumerSecret The OAuth consumer key secret.
$applicationId The application ID, optional.
$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 The session store implementation to use. See YahooSessionStore for more information. If no session store is provided, clearSession will instantiate a CookieSessionStore and use that.
$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.
Returns:
YahooSession The current session or NULL if a session cannot be established.


The documentation for this class was generated from the following file:

Generated on Thu Jun 18 14:55:31 2009 for Yahoo! OS SDK - PHP by  doxygen 1.5.8