jeremyFreeAgent / Bitter

Bitter is a simple but powerful analytics library
http://bitter.free-agent.fr
MIT License
129 stars 18 forks source link

Test Redis version to throw custom Exception #8

Closed stephpy closed 11 years ago

stephpy commented 11 years ago

I've test which fails, due to BITOP and BITCOUNT commands which are unknown.

I guess it's due to my version of redis, imo we should add in composer a require for redis server version.

jeremyFreeAgent commented 11 years ago

The required version of Redis is in the README. It's 2.6. But yes, its can be in composer.

stephpy commented 11 years ago

Yes, that's better to inform user with a custom exception IMO

tonypiper commented 11 years ago

actually, @stephpy, I had the same problem - I am running redis server 2.6 BUT snc_redis by default is expecting to work with 2.4, so you have to add a 'profile' option to your snc_redis configuration in config.yml.

snc_redis:
    clients:
        default:
            type: predis
            alias: default
            dsn: redis://localhost
            options:
                profile: 2.6

worth adding to the readme, @jeremyFreeAgent?

jeremyFreeAgent commented 11 years ago

Redis default version depends of your version of snc_redis !

stephpy commented 11 years ago

We cannot test via composer the version of redis. And it seems difficult to implement manual verification of version of client. Solutions i see:

1 / Create an interface for clients (which will complicate usage)

2 / Test existence of methods "bitop", etc ... when assign client to Bitter

3 / Let as it is. (may add a troubleshoot section on readme)

jeremyFreeAgent commented 11 years ago

We can test it via the INFO command, but it's a bad idea...

stephpy commented 11 years ago

@jeremyFreeAgent imo, call each times this command is a bad idea yep.

jeremyFreeAgent commented 11 years ago

I think it's to attire a better attention in README.

stephpy commented 11 years ago

:+1: I think that's the best way.