Auth_OpenID_FileStore Class Reference

Inheritance diagram for Auth_OpenID_FileStore:

Inheritance graph
[legend]
Collaboration diagram for Auth_OpenID_FileStore:

Collaboration graph
[legend]

List of all members.


Detailed Description

This file supplies a Memcached store backend for OpenID servers and consumers.

PHP versions 4 and 5

LICENSE: See the COPYING file included in this distribution.

Author:
JanRain, Inc. <[email protected]> 2005-2008 Janrain, Inc. http://www.apache.org/licenses/LICENSE-2.0 Apache Require base class for creating a new interface. This is a filesystem-based store for OpenID associations and nonces. This store should be safe for use in concurrent systems on both windows and unix (excluding NFS filesystems). There are a couple race conditions in the system, but those failure cases have been set up in such a way that the worst-case behavior is someone having to try to log in a second time.
Most of the methods of this class are implementation details. People wishing to just use this store need only pay attention to the constructor.

Definition at line 39 of file FileStore.php.


Public Member Functions

 Auth_OpenID_FileStore ($directory)
 destroy ()
 _setup ()
 _mktemp ()
 cleanupNonces ()
 getAssociationFilename ($server_url, $handle)
 storeAssociation ($server_url, $association)
 getAssociation ($server_url, $handle=null)
 _getAssociation ($filename)
 removeAssociation ($server_url, $handle)
 useNonce ($server_url, $timestamp, $salt)
 _allAssocs ()
 clean ()
 _rmtree ($dir)
 _mkstemp ($dir)
 _mkdtemp ($dir)
 _listdir ($dir)
 _isFilenameSafe ($char)
 _safe64 ($str)
 _filenameEscape ($str)
 _removeIfPresent ($filename)
 cleanupAssociations ()

Member Function Documentation

Auth_OpenID_FileStore.Auth_OpenID_FileStore ( directory  ) 

Initializes a new Auth_OpenID_FileStore. This initializes the nonce and association directories, which are subdirectories of the directory passed in.

Parameters:
string $directory This is the directory to put the store directories in.

Definition at line 49 of file FileStore.php.

Auth_OpenID_FileStore.destroy (  ) 

Definition at line 77 of file FileStore.php.

Auth_OpenID_FileStore._setup (  ) 

Make sure that the directories in which we store our data exist.

private

Definition at line 89 of file FileStore.php.

Auth_OpenID_FileStore._mktemp (  ) 

Create a temporary file on the same filesystem as $this->association_dir.

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.

Returns:
array ($fd, $filename) private

Definition at line 108 of file FileStore.php.

Auth_OpenID_FileStore.cleanupNonces (  ) 

Reimplemented from Auth_OpenID_OpenIDStore.

Definition at line 119 of file FileStore.php.

Auth_OpenID_FileStore.getAssociationFilename ( server_url,
handle 
)

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.

Returns:
string $filename

Definition at line 150 of file FileStore.php.

Auth_OpenID_FileStore.storeAssociation ( server_url,
association 
)

Store an association in the association directory.

Reimplemented from Auth_OpenID_OpenIDStore.

Definition at line 182 of file FileStore.php.

Auth_OpenID_FileStore.getAssociation ( server_url,
handle = null 
)

Retrieve an association. If no handle is specified, return the association with the most recent issue time.

Returns:
mixed $association

Reimplemented from Auth_OpenID_OpenIDStore.

Definition at line 232 of file FileStore.php.

Auth_OpenID_FileStore._getAssociation ( filename  ) 

private

Definition at line 296 of file FileStore.php.

Auth_OpenID_FileStore.removeAssociation ( server_url,
handle 
)

Remove an association if it exists. Do nothing if it does not.

Returns:
bool $success

Reimplemented from Auth_OpenID_OpenIDStore.

Definition at line 338 of file FileStore.php.

Auth_OpenID_FileStore.useNonce ( server_url,
timestamp,
salt 
)

Return whether this nonce is present. As a side effect, mark it as no longer present.

Returns:
bool $present

Reimplemented from Auth_OpenID_OpenIDStore.

Definition at line 360 of file FileStore.php.

Auth_OpenID_FileStore._allAssocs (  ) 

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

private

Definition at line 405 of file FileStore.php.

Auth_OpenID_FileStore.clean (  ) 

Definition at line 440 of file FileStore.php.

Auth_OpenID_FileStore._rmtree ( dir  ) 

private

Definition at line 469 of file FileStore.php.

Auth_OpenID_FileStore._mkstemp ( dir  ) 

private

Definition at line 507 of file FileStore.php.

Auth_OpenID_FileStore._mkdtemp ( dir  ) 

private

Definition at line 522 of file FileStore.php.

Auth_OpenID_FileStore._listdir ( dir  ) 

private

Definition at line 539 of file FileStore.php.

Auth_OpenID_FileStore._isFilenameSafe ( char  ) 

private

Definition at line 554 of file FileStore.php.

Auth_OpenID_FileStore._safe64 ( str  ) 

private

Definition at line 564 of file FileStore.php.

Auth_OpenID_FileStore._filenameEscape ( str  ) 

private

Definition at line 576 of file FileStore.php.

Auth_OpenID_FileStore._removeIfPresent ( filename  ) 

Attempt to remove a file, returning whether the file existed at the time of the call.

private

Returns:
bool $result True if the file was present, false if not.

Definition at line 599 of file FileStore.php.

Auth_OpenID_FileStore.cleanupAssociations (  ) 

Reimplemented from Auth_OpenID_OpenIDStore.

Definition at line 604 of file FileStore.php.


The documentation for this class was generated from the following file:

Generated on Thu Feb 19 15:03:25 2009 for OXID eShop CE by  doxygen 1.5.5