public __construct ( array $params ) | ||
$params | array | Required parameters: - secret (string): The secret string used for signing tokens. Optional parameters: - token_lifetime (integer): The number of seconds after which tokens time out. Negative numbers represent "no timeout". The default is "-1". - timeout (integer): The period (in seconds) after which an id is purged. DEFAULT: 86400 (24 hours) |
public function __construct($params)
{
if (!isset($params['secret'])) {
throw new Horde_Token_Exception('Missing secret parameter.');
}
$params = array_merge(array('token_lifetime' => -1, 'timeout' => 86400), $params);
$this->_params = $params;
}
/** * Constructor. * * @param array $params Parameters: * - collection: (string) The collection name. * - mongo_db: [REQUIRED] (Horde_Mongo_Client) A MongoDB client object. */ public function __construct(array $params = array()) { if (!isset($params['mongo_db'])) { throw new InvalidArgumentException('Missing mongo_db parameter.'); } parent::__construct(array_merge(array('collection' => 'horde_cache'), $params)); $this->_db = $this->_params['mongo_db']->selectCollection(null, $this->_params['collection']); }