public function __construct(array $options)
{
if (!isset($options['hosts']) || !is_array($options['hosts'])) {
throw new Exception('No hosts given in options');
}
if (isset($options['namespace'])) {
$this->namespace = $options['namespace'];
unset($options['namespace']);
}
if (isset($options['prefix'])) {
$this->prefix = $options['prefix'];
}
if (isset($options['set']) && !empty($options['set'])) {
$this->set = $options['set'];
unset($options['set']);
}
if (isset($options['lifetime'])) {
$this->lifetime = $options['lifetime'];
}
$persistent = false;
if (isset($options['persistent'])) {
$persistent = (bool) $options['persistent'];
}
$opts = [];
if (isset($options['options']) && is_array($options['options'])) {
$opts = $options['options'];
}
$this->db = new AerospikeDb(new FrontendData(['lifetime' => $this->lifetime]), ['hosts' => $options['hosts'], 'namespace' => $this->namespace, 'set' => $this->set, 'prefix' => $this->prefix, 'persistent' => $persistent, 'options' => $opts]);
parent::__construct($options);
session_set_save_handler([$this, 'open'], [$this, 'close'], [$this, 'read'], [$this, 'write'], [$this, 'destroy'], [$this, 'gc']);
}