PHP Class Auth_OpenID_SQLStore

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 {@link 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.
Inheritance: extends Auth_OpenID_OpenIDStore
Afficher le fichier Open project: openid/php-openid Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( connection $connection, $associations_table = null, $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.
_add_nonce ( $server_url, $timestamp, $salt )
_fixSQL ( )
_get_assoc ( $server_url, $handle )
_get_assocs ( $server_url )
_octify ( $str ) "Octifies" a binary string by returning a string with escaped octal bytes. This is used for preparing binary data for PostgreSQL BYTEA fields.
_set_assoc ( $server_url, $handle, $secret, $issued, $lifetime, $assoc_type )
_unoctify ( $str ) "Unoctifies" octal-escaped data from PostgreSQL and returns the resulting ASCII (possibly binary) string.
_verifySQL ( )
blobDecode ( $blob )
blobEncode ( $str )
cleanupAssociations ( )
cleanupNonces ( )
createTables ( )
create_assoc_table ( )
create_nonce_table ( )
getAssociation ( $server_url, $handle = null )
isError ( $value ) Returns true if $value constitutes a database error; returns false otherwise.
removeAssociation ( $server_url, $handle )
reset ( ) Resets the store by removing all records from the store's tables.
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.
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.
storeAssociation ( $server_url, $association )
tableExists ( $table_name )
useNonce ( $server_url, $timestamp, $salt )

Method Details

__construct() public méthode

This creates a new SQLStore instance. It requires an established database connection be given to it, and it allows overriding the default table names.
public __construct ( connection $connection, $associations_table = null, $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.

_add_nonce() public méthode

public _add_nonce ( $server_url, $timestamp, $salt )

_fixSQL() public méthode

public _fixSQL ( )

_get_assoc() public méthode

public _get_assoc ( $server_url, $handle )

_get_assocs() public méthode

public _get_assocs ( $server_url )

_octify() public méthode

"Octifies" a binary string by returning a string with escaped octal bytes. This is used for preparing binary data for PostgreSQL BYTEA fields.
public _octify ( $str )

_set_assoc() public méthode

public _set_assoc ( $server_url, $handle, $secret, $issued, $lifetime, $assoc_type )

_unoctify() public méthode

"Unoctifies" octal-escaped data from PostgreSQL and returns the resulting ASCII (possibly binary) string.
public _unoctify ( $str )

_verifySQL() public méthode

public _verifySQL ( )

blobDecode() public méthode

public blobDecode ( $blob )

blobEncode() public méthode

public blobEncode ( $str )

cleanupAssociations() public méthode

public cleanupAssociations ( )

cleanupNonces() public méthode

public cleanupNonces ( )

createTables() public méthode

public createTables ( )

create_assoc_table() public méthode

public create_assoc_table ( )

create_nonce_table() public méthode

public create_nonce_table ( )

getAssociation() public méthode

public getAssociation ( $server_url, $handle = null )

isError() public méthode

Returns true if $value constitutes a database error; returns false otherwise.
public isError ( $value )

removeAssociation() public méthode

public removeAssociation ( $server_url, $handle )

reset() public méthode

Resets the store by removing all records from the store's tables.
public reset ( )

resultToBool() public méthode

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.
public resultToBool ( $obj )

setSQL() public méthode

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

storeAssociation() public méthode

public storeAssociation ( $server_url, $association )

tableExists() public méthode

public tableExists ( $table_name )

useNonce() public méthode

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