Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: OpenID

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class Auth_OpenID_SQLStore

Description

This is the parent class for the SQL stores, which contains the logic common to all of the SQL stores.

The table names used are determined by the class variables settings_table_name, associations_table_name, and nonces_table_name. To change the name of the tables used, pass new table names into the constructor.

To create the tables with the proper schema, see the createTables method.

This class shouldn't be used directly. Use one of its subclasses instead, as those contain the code necessary to use a specific database. If you're an OpenID integrator and you'd like to create an SQL-driven store that wraps an application's database abstraction, be sure to create a subclass of Auth_OpenID_DatabaseConnection that calls the application's database abstraction calls. Then, pass an instance of your new database connection class to your SQLStore subclass constructor.

All methods other than the constructor and createTables should be considered implementation details.

Located in /openid/Auth/OpenID/SQLStore.php (line 57)

Class Auth_OpenID_OpenIDStore

Class Auth_OpenID_SQLStore
Direct descendents
Class Description
ClassAuth_OpenID_SQLiteStore An SQL store that uses SQLite as its backend.
ClassAuth_OpenID_MySQLStore An SQL store that uses MySQL as its backend.
Method Summary
Constructor Auth_OpenID_SQLStore Auth_OpenID_SQLStore (connection $connection, [string $settings_table = null], [associations_table: $associations_table = null], [nonces_table: $nonces_table = null])
Method void blobDecode ( $blob)
Method void blobEncode ( $str)
Method void createTables ()
Method void getAssociation ( $server_url, [ $handle = null])
Method void getAuthKey ()
Method void isError ( $value)
Method void removeAssociation ( $server_url,  $handle)
Method void reset ()
Method void resultToBool ( $obj)
Method void setSQL ()
Method void storeAssociation ( $server_url,  $association)
Method void tableExists ( $table_name)
Method void useNonce ( $nonce)
Variables
Methods
Constructor Auth_OpenID_SQLStore (line 82)

This creates a new SQLStore instance. It requires an established database connection be given to it, and it allows overriding the default table names.

Auth_OpenID_SQLStore Auth_OpenID_SQLStore (connection $connection, [string $settings_table = null], [associations_table: $associations_table = null], [nonces_table: $nonces_table = null])
  • connection $connection: This must be an established connection to a database of the correct type for the SQLStore subclass you're using. This must either be an PEAR DB connection handle or an instance of a subclass of Auth_OpenID_DatabaseConnection.
  • string $settings_table: This is an optional parameter to specify the name of the table used for this store's settings. The default value is 'oid_settings'.
  • associations_table: $associations_table: This is an optional parameter to specify the name of the table used for storing associations. The default value is 'oid_associations'.
  • nonces_table: $nonces_table: This is an optional parameter to specify the name of the table used for storing nonces. The default value is 'oid_nonces'.
blobDecode (line 301)
void blobDecode ( $blob)
  • $blob
blobEncode (line 306)
void blobEncode ( $str)
  • $str
createTables (line 311)
void createTables ()
create_assoc_table (line 335)
void create_assoc_table ()
create_nonce_table (line 326)
void create_nonce_table ()
create_settings_table (line 344)
void create_settings_table ()
getAssociation (line 475)
void getAssociation ( $server_url, [ $handle = null])
  • $server_url
  • $handle

Redefinition of:
Auth_OpenID_OpenIDStore::getAssociation()
This method returns an Association object from storage that matches the server URL and, if specified, handle. It returns null if no such association is found or if the matching association is expired.
getAuthKey (line 370)
void getAuthKey ()

Redefinition of:
Auth_OpenID_OpenIDStore::getAuthKey()
This method returns a key used to sign the tokens, to ensure that they haven't been tampered with in transit. It should return the same key every time it is called. The key returned should be AUTH_KEY_LEN bytes long.
isError (line 177)

Returns true if $value constitutes a database error; returns false otherwise.

void isError ( $value)
  • $value
removeAssociation (line 458)
void removeAssociation ( $server_url,  $handle)
  • $server_url
  • $handle

Redefinition of:
Auth_OpenID_OpenIDStore::removeAssociation()
This method removes the matching association if it's found, and returns whether the association was removed or not.
reset (line 209)

Resets the store by removing all records from the store's tables.

void reset ()

Redefinition of:
Auth_OpenID_OpenIDStore::reset()
Removes all entries from the store; implementation is optional.
resultToBool (line 187)

Converts a query result to a boolean. If the result is a database error according to $this->isError(), this returns false; otherwise, this returns true.

void resultToBool ( $obj)
  • $obj
setSQL (line 201)

This method should be overridden by subclasses. This method is called by the constructor to set values in $this->sql, which is an array keyed on sql name.

void setSQL ()

Redefined in descendants as:
storeAssociation (line 412)
void storeAssociation ( $server_url,  $association)
  • $server_url
  • $association

Redefinition of:
Auth_OpenID_OpenIDStore::storeAssociation()
This method puts an Association object into storage, retrievable by server URL and handle.
tableExists (line 166)
void tableExists ( $table_name)
  • $table_name
useNonce (line 575)
void useNonce ( $nonce)
  • $nonce

Redefinition of:
Auth_OpenID_OpenIDStore::useNonce()
This method is called when the library is attempting to use a nonce. If the nonce is in the store, this method removes it and returns a value which evaluates as true. Otherwise it returns a value which evaluates as false.

Inherited Methods

Inherited From Auth_OpenID_OpenIDStore

 Auth_OpenID_OpenIDStore::getAssociation()
 Auth_OpenID_OpenIDStore::getAuthKey()
 Auth_OpenID_OpenIDStore::isDumb()
 Auth_OpenID_OpenIDStore::removeAssociation()
 Auth_OpenID_OpenIDStore::reset()
 Auth_OpenID_OpenIDStore::storeAssociation()
 Auth_OpenID_OpenIDStore::storeNonce()
 Auth_OpenID_OpenIDStore::useNonce()

Documentation generated on Mon, 05 Mar 2007 21:26:49 +0000 by phpDocumentor 1.3.1