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
파일 보기 프로젝트 열기: openid/php-openid 1 사용 예제들

공개 메소드들

메소드 설명
__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 )