コード例 #1
0
 /**
  * constructor
  *
  * @param array $options        associative array of cache driver options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (isset($options['rediska'])) {
         if ($options['rediska'] instanceof Rediska) {
             $this->_rediska = $options['rediska'];
         } else {
             throw new Doctrine_Cache_Exception('The rediska instance supplied to Doctrine_Cache_Redis is not a Rediska object.');
         }
     } else {
         $instance = $this->getOption('instance', 'default');
         $this->_rediska = sfRediska::getInstance($instance);
     }
 }
コード例 #2
0
 /**
  * Instantiate Rediska client and initialise it with all servers listed in the instance
  *
  * Available options :
  * * instance: which instance of redis servers to work with (defined in app.yml, app_redis_default by default)
  *
  * @see sfCache
  */
 public function initialize($options = array())
 {
     parent::initialize($options);
     $instance = $this->getOption('instance', 'default');
     $this->_rediska = sfRediska::getInstance($instance);
 }