Auth_OpenID_FileStore::__construct PHP Method

__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.
    function __construct($directory)
    {
        if (!Auth_OpenID::ensureDir($directory)) {
            trigger_error('Not a directory and failed to create: ' . $directory, E_USER_ERROR);
        }
        $directory = realpath($directory);
        $this->directory = $directory;
        $this->active = true;
        $this->nonce_dir = $directory . DIRECTORY_SEPARATOR . 'nonces';
        $this->association_dir = $directory . DIRECTORY_SEPARATOR . 'associations';
        // Temp dir must be on the same filesystem as the assciations
        // $directory.
        $this->temp_dir = $directory . DIRECTORY_SEPARATOR . 'temp';
        $this->max_nonce_age = 6 * 60 * 60;
        // Six hours, in seconds
        if (!$this->_setup()) {
            trigger_error('Failed to initialize OpenID file store in ' . $directory, E_USER_ERROR);
        }
    }