Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

allow dispatching of unknown methods to redis connection object #656

Merged
merged 1 commit into from Sep 24, 2012

Conversation

Projects
None yet
2 participants
Member

d1rk commented Sep 24, 2012

Recently, i was using redis more often. The already implemented cache-adapter is just a start but it allows for easy access to the redis backend.

Some of the functions of redis are not available through the cache adapter, though. As stated in storage\Cache it is easy to use custom methods on cache-adapters like that:

Cache::adapter('named-configuration')->methodName($argument);

That way, it would be easily possible to use custom functions on the redis-adapter. After i created an extension, building some functionality i needed for my project i finally came to this easy, yet powerful way of extending the current redis adapter to allow for dispatching of methods on to the redis connection object.

As this is just an add-on to the existing functionality it might be useful to others. What do you think?

Another way of achieving a similar functionality (without using magic methods) would be to have a method called command or exec or what comes to your mind, that takes 2 parameters. First one would be the name of the method to call, second an array with parameters to be passed into that method. If you would prefer that way, just give me a note.

I think, as lithium makes it easy to get your fingers into these innovative technologies it should make it easy to go beyond the basic functionality and let people grow with that from what they have.

EDIT: This is pointing to 'dev' and has a unit-test, references #653 and #654 - sorry for the mess, was not sure how to squash commits after push.

nateabele added a commit that referenced this pull request Sep 24, 2012

Merge pull request #656 from d1rk/redis-method-dispatch
allow dispatching of unknown methods to redis connection object

@nateabele nateabele merged commit 06fc157 into UnionOfRAD:dev Sep 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment