Class Horde_Token_sql

Description

Token tracking implementation for PHP's PEAR database abstraction layer.

Required parameters:

   'phptype'      The database type (ie. 'pgsql', 'mysql', etc.).

Required by some database implementations:

   '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.

Optional parameters:

   '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).

Optional values when using separate reading and writing servers, for example in replication settings:

   'splitread'   Boolean, whether to implement the separation or not.
   'read'        Array containing the parameters which are different for
                 the read database connection, currently supported
                 only 'hostspec' and 'port' parameters.

The table structure for the tokens is as follows:

 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)
 );

$Horde: framework/Token/Token/sql.php,v 1.23.6.17 2009/02/13 05:45:19 chuck Exp $

Copyright 1999-2009 The Horde Project (http://www.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.

Located in /Token/Token/sql.php (line 53)

Horde_Token
   |
   --Horde_Token_sql
Variable Summary
 boolean $_connected
 DB $_db
Method Summary
 Horde_Token_sql Horde_Token_sql ([array $params = array()])
 void add ( $tokenID)
 void exists ( $tokenID)
 boolean purge ()
 boolean _connect ()
Variables
boolean $_connected = false (line 76)

Boolean indicating whether or not we're connected to the SQL server.

DB $_db = '' (line 60)

Handle for the current database connection.

DB $_write_db (line 68)

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Inherited Variables

Inherited from Horde_Token

Horde_Token::$_params
Methods
Constructor Horde_Token_sql (line 83)

Constructs a new SQL connection object.

Horde_Token_sql Horde_Token_sql ([array $params = array()])
  • array $params: A hash containing connection parameters.
add (line 141)
void add ( $tokenID)
  • $tokenID

Redefinition of:
Horde_Token::add()
This is an abstract method that should be overridden by a subclass implementation. The base implementation allows all token values.
exists (line 120)
void exists ( $tokenID)
  • $tokenID

Redefinition of:
Horde_Token::exists()
This is an abstract method that should be overridden by a subclass implementation. The base implementation allows all token values.
purge (line 98)

Deletes all expired connection id's from the SQL server.

  • return: True on success, a PEAR_Error object on failure.
boolean purge ()

Redefinition of:
Horde_Token::purge()
This is an abstract method that should be overridden by a subclass implementation. The base implementation allows all token values.
_connect (line 168)

Opens a connection to the SQL server.

  • return: True on success, a PEAR_Error object on failure.
boolean _connect ()

Inherited Methods

Inherited From Horde_Token

 Horde_Token::Horde_Token()
 Horde_Token::add()
 Horde_Token::encodeRemoteAddress()
 Horde_Token::exists()
 Horde_Token::factory()
 Horde_Token::generateId()
 Horde_Token::purge()
 Horde_Token::singleton()
 Horde_Token::verify()

Documentation generated on Sun, 30 Jan 2011 05:21:53 +0000 by phpDocumentor 1.4.3