/** * 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']); }
/** * Constructor. * * @see Horde_Token_Base::__construct() for more parameters. * * @param array $params Required parameters: * - db (Horde_Db_Adapter): The DB instance. * Optional parameters: * - table (string): The name of the tokens table. * DEFAULT: 'horde_tokens' * </pre> * * @throws Horde_Token_Exception */ public function __construct($params = array()) { if (!isset($params['db'])) { throw new Horde_Token_Exception('Missing db parameter.'); } $this->_db = $params['db']; unset($params['db']); $params = array_merge(array('table' => 'horde_tokens'), $params); parent::__construct($params); }
/** * Constructor. * * @see Horde_Token_Base::__construct() for more parameters. * * @param array $params Optional parameters: * - token_dir (string): The directory where to keep token files. * DEFAULT: System temporary directory */ public function __construct($params = array()) { $params = array_merge(array('token_dir' => sys_get_temp_dir()), $params); parent::__construct($params); }