Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Max Kalika (max@horde.org)
Author: Chuck Hagenbuch (chuck@horde.org)
Esempio n. 1
0
 /**
  * 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']);
 }
Esempio n. 2
0
File: Sql.php Progetto: horde/horde
 /**
  * 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);
 }
Esempio n. 3
0
 /**
  * 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);
 }