public function build()
    {
        if ($this->handler) {
            $handler = $this->handler;
        } elseif ($this->pdo || $this->dbCredentials) {
            $options = $this->dbCredentials;
            $options['table'] = $this->table;
            if ($this->pdo) {
                $options['pdo'] = $this->pdo;
            }
            $handler = new PdoHandler($options);
        } else {
            $handler = new FileHandler($this->locking);
        }
        return new Session($handler, $this->name, $this->savePath, $this->serializer);
    }
public function build()
    {
        if ($this->handler) {
            $handler = $this->handler;
        } elseif ($this->pdo || $this->dbCredentials) {
            $options = $this->dbCredentials;
            $options['table'] = $this->table;
            if ($this->pdo) {
                $options['pdo'] = $this->pdo;
            }
            $handler = new PdoHandler($options);
        } else {
            $handler = new FileHandler($this->locking);
        }
        return new Session($handler, $this->name, $this->savePath, $this->serializer);
    }
public function build ( ) { if ( $ this -> handler ) { $ handler = $ this -> handler ; } elseif ( $ this -> pdo || $ this -> dbCredentials ) { $ options = $ this -> dbCredentials ; $ options [ 'table' ] = $ this -> table ; if ( $ this -> pdo ) { $ options [ 'pdo' ] = $ this -> pdo ; } $ handler = new PdoHandler ( $ options ) ; } else { $ handler = new FileHandler ( $ this -> locking ) ; } return new Session ( $ handler , $ this -> name , $ this -> savePath , $ this -> serializer ) ; }
Create a new session with the appropriate storage handler

@return Session
Create a new session with the appropriate storage handler