PHP Класс 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.
Наследование: extends Auth_OpenID_OpenIDStore
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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 )

Описание методов

__construct() публичный Метод

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 _add_nonce ( $server_url, $timestamp, $salt )

_fixSQL() публичный Метод

public _fixSQL ( )

_get_assoc() публичный Метод

public _get_assoc ( $server_url, $handle )

_get_assocs() публичный Метод

public _get_assocs ( $server_url )

_octify() публичный Метод

"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 _set_assoc ( $server_url, $handle, $secret, $issued, $lifetime, $assoc_type )

_unoctify() публичный Метод

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

_verifySQL() публичный Метод

public _verifySQL ( )

blobDecode() публичный Метод

public blobDecode ( $blob )

blobEncode() публичный Метод

public blobEncode ( $str )

cleanupAssociations() публичный Метод

public cleanupAssociations ( )

cleanupNonces() публичный Метод

public cleanupNonces ( )

createTables() публичный Метод

public createTables ( )

create_assoc_table() публичный Метод

public create_assoc_table ( )

create_nonce_table() публичный Метод

public create_nonce_table ( )

getAssociation() публичный Метод

public getAssociation ( $server_url, $handle = null )

isError() публичный Метод

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

removeAssociation() публичный Метод

public removeAssociation ( $server_url, $handle )

reset() публичный Метод

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

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

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

storeAssociation() публичный Метод

public storeAssociation ( $server_url, $association )

tableExists() публичный Метод

public tableExists ( $table_name )

useNonce() публичный Метод

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