CI Redis cache driver |
Hi,
In CI version 3.x we have Redis support. Official documentation for 'more information' points to https://github.com/phpredis/phpredis But if I user for example: Code: $this->cache->redis->hSet('h', 'key1', 'hello'); Also in system\libraries\Cache\drivers\Cache_redis.php We have ony save, get, delete, increment, decrement, clean, cache_info, get_metadata How I can use this? What to do? Thanks
It's more information on what's used in the CI implementation, not a list of additional methods.
And why we do not have additional methods?
What's the point to disable hmaps in redis in CI library? :S
The Cache library is an abstraction ... it provides a common, often easier to use interface to its underlying drivers. It doesn't "disable" methods like you're saying.
If you want to, and know that you will only use Redis, then use phpRedis directly.
No, it is not a redis library it is a cache library. The whole point here is that it provides a wrapper for common functions that exists in all the supported cache systems. This allows you to switch from redis to memcache etc by only changing your config file. It makes no sense to provide functions for a specific system in an abstraction layer like Narf said.
If you want / need redis specific functions you need to use the official phpredis class. This should give you no troubles unless you need to switch from redis to another cache system, then you will need to do some rewriting in your code.
that is stupid... and probably the reason why CI is losing developers
if you are doing something do it all the way and not just half way (09-10-2016, 05:40 AM)consigliere Wrote: that is stupid... and probably the reason why CI is losing developers I'm sorry you cannot grasp the concept of a generalized abstraction layer. That has absolutely nothing to do with CI or it's popularity. Why would you expect CI to wrIteie a complete wrapper for Redis when phpredis can do that job perfectly? Again, you can include phpredis in just q handfull of lines of code in CI, or any other framework if you like. You are not bound to the CI cache implementation. |
Welcome Guest, Not a member yet? Register Sign In |