[ class tree: OpenID ] [ index: OpenID ] [ all elements ]

Class: Auth_OpenID_SQLStore

Source Location: /zp-extensions/federated_logon/Auth/OpenID/SQLStore.php

Class Auth_OpenID_SQLStore

Class Overview

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 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 /zp-extensions/federated_logon/Auth/OpenID/SQLStore.php [line 57]

Auth_OpenID_OpenIDStore
   |
   --Auth_OpenID_SQLStore
Author(s): Information Tags:

Methods

[ Top ]
Descendants
Child Class Description
Auth_OpenID_MySQLStore An SQL store that uses MySQL as its backend.
Auth_OpenID_PostgreSQLStore An SQL store that uses PostgreSQL as its backend.
Auth_OpenID_SQLiteStore An SQL store that uses SQLite as its backend.

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Auth_OpenID_OpenIDStore

Auth_OpenID_OpenIDStore::cleanup()
Auth_OpenID_OpenIDStore::cleanupAssociations()
Auth_OpenID_OpenIDStore::cleanupNonces()
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.
Auth_OpenID_OpenIDStore::removeAssociation()
This method removes the matching association if it's found, and returns whether the association was removed or not.
Auth_OpenID_OpenIDStore::reset()
Removes all entries from the store; implementation is optional.
Auth_OpenID_OpenIDStore::storeAssociation()
This method puts an Association object into storage, retrievable by server URL and handle.
Auth_OpenID_OpenIDStore::supportsCleanup()
Report whether this storage supports cleanup
Auth_OpenID_OpenIDStore::useNonce()
Called when using a nonce.

[ Top ]
Method Summary
Auth_OpenID_SQLStore   Auth_OpenID_SQLStore()   This creates a new SQLStore instance. It requires an established database connection be given to it, and it allows overriding the default table names.
void   blobDecode()  
void   blobEncode()  
void   cleanupAssociations()  
void   cleanupNonces()  
void   createTables()  
void   create_assoc_table()  
void   create_nonce_table()  
void   getAssociation()  
void   isError()   Returns true if $value constitutes a database error; returns false otherwise.
void   removeAssociation()  
void   reset()   Resets the store by removing all records from the store's tables.
void   resultToBool()   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   setSQL()   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   storeAssociation()  
void   tableExists()  
void   useNonce()  

[ Top ]
Methods
Constructor Auth_OpenID_SQLStore  [line 78]

  Auth_OpenID_SQLStore Auth_OpenID_SQLStore( connection $connection, [associations_table: $associations_table = null], [nonces_table: $nonces_table = null]  )

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

Parameters:
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.
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'.


[ Top ]
blobDecode  [line 276]

  void blobDecode( $blob  )

Parameters:
   $blob: 


[ Top ]
blobEncode  [line 281]

  void blobEncode( $str  )

Parameters:
   $str: 


[ Top ]
cleanupAssociations  [line 547]

  void cleanupAssociations( )



Redefinition of:
Auth_OpenID_OpenIDStore::cleanupAssociations()

[ Top ]
cleanupNonces  [line 536]

  void cleanupNonces( )



Redefinition of:
Auth_OpenID_OpenIDStore::cleanupNonces()

[ Top ]
createTables  [line 286]

  void createTables( )



[ Top ]
create_assoc_table  [line 309]

  void create_assoc_table( )



[ Top ]
create_nonce_table  [line 300]

  void create_nonce_table( )



[ Top ]
getAssociation  [line 397]

  void getAssociation( $server_url, [ $handle = null]  )

Parameters:
   $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.

[ Top ]
isError  [line 167]

  void isError( $value  )

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

Parameters:
   $value: 


[ Top ]
removeAssociation  [line 380]

  void removeAssociation( $server_url, $handle  )

Parameters:
   $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.

[ Top ]
reset  [line 199]

  void reset( )

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



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

[ Top ]
resultToBool  [line 177]

  void resultToBool( $obj  )

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.

Parameters:
   $obj: 


[ Top ]
setSQL  [line 191]

  void setSQL( )

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.



Redefined in descendants as:

[ Top ]
storeAssociation  [line 334]

  void storeAssociation( $server_url, $association  )

Parameters:
   $server_url: 
   $association: 


Redefinition of:
Auth_OpenID_OpenIDStore::storeAssociation()
This method puts an Association object into storage, retrievable by server URL and handle.

[ Top ]
tableExists  [line 155]

  void tableExists( $table_name  )

Parameters:
   $table_name: 


[ Top ]
useNonce  [line 468]

  void useNonce( $server_url, $timestamp, $salt  )

Parameters:
   $server_url: 
   $timestamp: 
   $salt: 


Redefinition of:
Auth_OpenID_OpenIDStore::useNonce()
Called when using a nonce.

[ Top ]

Documentation generated on Sat, 05 Jan 2013 15:51:26 +0100 by phpDocumentor 1.4.3