PHP Class Auth_OpenID_FileStore

Most of the methods of this class are implementation details. People wishing to just use this store need only pay attention to the constructor.
Inheritance: extends Auth_OpenID_OpenIDStore
Mostrar archivo Open project: openid/php-openid Class Usage Examples

Public Methods

Method Description
__construct ( string $directory ) Initializes a new {@link Auth_OpenID_FileStore}. This initializes the nonce and association directories, which are subdirectories of the directory passed in.
_allAssocs ( ) Remove expired entries from the database. This is potentially expensive, so only run when it is acceptable to take time.
_filenameEscape ( $str )
_getAssociation ( $filename )
_isFilenameSafe ( $char )
_listdir ( $dir )
_mkdtemp ( $dir )
_mkstemp ( $dir )
_mktemp ( ) : array Create a temporary file on the same filesystem as $this->association_dir.
_removeIfPresent ( $filename ) : boolean Attempt to remove a file, returning whether the file existed at the time of the call.
_rmtree ( $dir )
_safe64 ( $str )
_setup ( ) Make sure that the directories in which we store our data exist.
clean ( )
cleanupAssociations ( )
cleanupNonces ( )
destroy ( )
getAssociation ( $server_url, $handle = null ) : mixed Retrieve an association. If no handle is specified, return the association with the most recent issue time.
getAssociationFilename ( $server_url, $handle ) : string Create a unique filename for a given server url and handle. This implementation does not assume anything about the format of the handle. The filename that is returned will contain the domain name from the server URL for ease of human inspection of the data directory.
removeAssociation ( $server_url, $handle ) : boolean Remove an association if it exists. Do nothing if it does not.
storeAssociation ( $server_url, $association ) Store an association in the association directory.
useNonce ( $server_url, $timestamp, $salt ) : boolean Return whether this nonce is present. As a side effect, mark it as no longer present.

Method Details

__construct() public method

Initializes a new {@link Auth_OpenID_FileStore}. This initializes the nonce and association directories, which are subdirectories of the directory passed in.
public __construct ( string $directory )
$directory string This is the directory to put the store directories in.

_allAssocs() public method

Remove expired entries from the database. This is potentially expensive, so only run when it is acceptable to take time.
public _allAssocs ( )

_filenameEscape() public method

public _filenameEscape ( $str )

_getAssociation() public method

public _getAssociation ( $filename )

_isFilenameSafe() public method

public _isFilenameSafe ( $char )

_listdir() public method

public _listdir ( $dir )

_mkdtemp() static public method

static public _mkdtemp ( $dir )

_mkstemp() public method

public _mkstemp ( $dir )

_mktemp() public method

The temporary directory should not be cleaned if there are any processes using the store. If there is no active process using the store, it is safe to remove all of the files in the temporary directory.
public _mktemp ( ) : array
return array ($fd, $filename)

_removeIfPresent() public method

Attempt to remove a file, returning whether the file existed at the time of the call.
public _removeIfPresent ( $filename ) : boolean
return boolean $result True if the file was present, false if not.

_rmtree() public method

public _rmtree ( $dir )

_safe64() public method

public _safe64 ( $str )

_setup() public method

Make sure that the directories in which we store our data exist.
public _setup ( )

clean() public method

public clean ( )

cleanupAssociations() public method

public cleanupAssociations ( )

cleanupNonces() public method

public cleanupNonces ( )

destroy() public method

public destroy ( )

getAssociation() public method

Retrieve an association. If no handle is specified, return the association with the most recent issue time.
public getAssociation ( $server_url, $handle = null ) : mixed
return mixed $association

getAssociationFilename() public method

Create a unique filename for a given server url and handle. This implementation does not assume anything about the format of the handle. The filename that is returned will contain the domain name from the server URL for ease of human inspection of the data directory.
public getAssociationFilename ( $server_url, $handle ) : string
return string $filename

removeAssociation() public method

Remove an association if it exists. Do nothing if it does not.
public removeAssociation ( $server_url, $handle ) : boolean
return boolean $success

storeAssociation() public method

Store an association in the association directory.
public storeAssociation ( $server_url, $association )

useNonce() public method

Return whether this nonce is present. As a side effect, mark it as no longer present.
public useNonce ( $server_url, $timestamp, $salt ) : boolean
return boolean $present