Classe: Horde_Token_sql - X-Ref
Token tracking implementation for PHP's PEAR database abstraction layer.
Required parameters:<pre>
'phptype' The database type (ie. 'pgsql', 'mysql', etc.).</pre>
Required by some database implementations:<pre>
'database' The name of the database.
'hostspec' The hostname of the database server.
'username' The username with which to connect to the database.
'password' The password associated with 'username'.
'options' Additional options to pass to the database.
'tty' The TTY on which to connect to the database.
'port' The port on which to connect to the database.</pre>
Optional parameters:<pre>
'table' The name of the tokens table in 'database'.
Defaults to 'horde_tokens'.
'timeout' The period (in seconds) after which an id is purged.
Defaults to 86400 (i.e. 24 hours).</pre>
The table structure for the tokens is as follows:
<pre>
CREATE TABLE horde_tokens (
token_address VARCHAR(100) NOT NULL,
token_id VARCHAR(32) NOT NULL,
token_timestamp BIGINT NOT NULL,
PRIMARY KEY (token_address, token_id)
);
</pre>
$Horde: framework/Token/Token/sql.php,v 1.23.6.12 2006/01/18 19:40:51 ben Exp $
Copyright 1999-2006 Max Kalika <max@horde.org>
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
Horde_Token_sql($params = array()
X-Ref
|
Constructs a new SQL connection object.
param: array $params A hash containing connection parameters.
|
purge()
X-Ref
|
Deletes all expired connection id's from the SQL server.
return: boolean True on success, a PEAR_Error object on failure.
|
_connect()
X-Ref
|
Opens a connection to the SQL server.
return: boolean True on success, a PEAR_Error object on failure.
|
_disconnect()
X-Ref
|
Disconnect from the SQL server and clean up the connection.
return: boolean True on success, a PEAR_Error object on failure.
|