public function create(PropertyAccess $conf)
    {
        $type = $conf->get(['main', 'session', 'type'], 'file');
        $options = $conf->get(['main', 'session', 'options'], []);
        $serverOpts = [
            'expiretime' => $conf->get(['main', 'session', 'ttl'], 86400),
            'prefix'     => $conf->get(['main', 'key']),
        ];

        switch (strtolower($type)) {
            case 'memcache':
                return new WriteCheckSessionHandler(
                    new MemcacheSessionHandler(
                        $this->connectionFactory->getMemcacheConnection($options, $serverOpts)
                    )
                );
            case 'memcached':
                return new WriteCheckSessionHandler(
                    new MemcachedSessionHandler(
                        $this->connectionFactory->getMemcachedConnection($options, $serverOpts)
                    )
                );
            case 'file':
                return new NativeFileSessionHandler(isset($options['save-path']) ? $options['save-path'] : null);
            case 'redis':
                return new WriteCheckSessionHandler(
                    new RedisSessionHandler(
                        $this->connectionFactory->getRedisConnection($options, $serverOpts)
                    )
                );
            case 'native':
                return new NativeSessionHandler();
        }

        throw new RuntimeException(sprintf('Unable to create the specified session handler "%s"', $type));
    }
public function create(PropertyAccess $conf)
    {
        $type = $conf->get(['main', 'session', 'type'], 'file');
        $options = $conf->get(['main', 'session', 'options'], []);
        $serverOpts = [
            'expiretime' => $conf->get(['main', 'session', 'ttl'], 86400),
            'prefix'     => $conf->get(['main', 'key']),
        ];

        switch (strtolower($type)) {
            case 'memcache':
                return new WriteCheckSessionHandler(
                    new MemcacheSessionHandler(
                        $this->connectionFactory->getMemcacheConnection($options, $serverOpts)
                    )
                );
            case 'memcached':
                return new WriteCheckSessionHandler(
                    new MemcachedSessionHandler(
                        $this->connectionFactory->getMemcachedConnection($options, $serverOpts)
                    )
                );
            case 'file':
                return new NativeFileSessionHandler(isset($options['save-path']) ? $options['save-path'] : null);
            case 'redis':
                return new WriteCheckSessionHandler(
                    new RedisSessionHandler(
                        $this->connectionFactory->getRedisConnection($options, $serverOpts)
                    )
                );
            case 'native':
                return new NativeSessionHandler();
        }

        throw new RuntimeException(sprintf('Unable to create the specified session handler "%s"', $type));
    }
public function create ( PropertyAccess $ conf ) { $ type = $ conf -> get ( [ 'main' , 'session' , 'type' ] , 'file' ) ; $ options = $ conf -> get ( [ 'main' , 'session' , 'options' ] , [ ] ) ; $ serverOpts = [ 'expiretime' => $ conf -> get ( [ 'main' , 'session' , 'ttl' ] , 86400 ) , 'prefix' => $ conf -> get ( [ 'main' , 'key' ] ) , ] ; switch ( strtolower ( $ type ) ) { case 'memcache' : return new WriteCheckSessionHandler ( new MemcacheSessionHandler ( $ this -> connectionFactory -> getMemcacheConnection ( $ options , $ serverOpts ) ) ) ; case 'memcached' : return new WriteCheckSessionHandler ( new MemcachedSessionHandler ( $ this -> connectionFactory -> getMemcachedConnection ( $ options , $ serverOpts ) ) ) ; case 'file' : return new NativeFileSessionHandler ( isset ( $ options [ 'save-path' ] ) ? $ options [ 'save-path' ] : null ) ; case 'redis' : return new WriteCheckSessionHandler ( new RedisSessionHandler ( $ this -> connectionFactory -> getRedisConnection ( $ options , $ serverOpts ) ) ) ; case 'native' : return new NativeSessionHandler ( ) ; } throw new RuntimeException ( sprintf ( 'Unable to create the specified session handler "%s"' , $ type ) ) ; }
Creates a SessionHandlerInterface given a conf.

@param PropertyAccess $conf

@return \SessionHandlerInterface

@throws \Alchemy\Phrasea\Exception\RuntimeException
Creates a SessionHandlerInterface given a conf .