/** * {@inheritdoc} * * @param null|array $options * @throws \Phalcon\Mvc\Model\Exception */ public function __construct($options = null) { if (is_array($options)) { if (!isset($options['redis'])) { throw new Exception('Parameter "redis" is required'); } } else { throw new Exception('No configuration given'); } parent::__construct($options); }
/** * {@inheritdoc} * * @param null|array $options options array * * @throws \Phalcon\Mvc\Model\Exception */ public function __construct($options = null) { if (!is_array($options)) { throw new Exception('No configuration given'); } if (!isset($options['host'])) { throw new Exception('No host given in options'); } if (!isset($options['port'])) { $options['port'] = self::$defaultPort; } if (!isset($options['weight'])) { $options['weight'] = self::$defaultWeight; } parent::__construct($options); }
/** * {@inheritdoc} * * @param string $key * @return string */ protected function prepareKey($key) { return str_replace('\\', ':', parent::prepareKey($key)); }
/** * Returns the sessionId with prefix * * @param string $id * @return string */ protected function getId($id) { return str_replace('\\', ':', parent::getId($id)); }