Well, this post explains the previous one.
I wanted to create a simple web proxy for redis.
It simply takes the url path and passes it to Redis, getting the response back either Raw or encoded in Json.
On the choice of redisent see http://dev.af83.com/redis/which-php-library-use-redis/2010/12/30
Using it is as simple as :
$redishttp= new RedisHTTP(); echo json_encode(RedisHTTP::run());
So simply visiting
Will Set the key “Hello” to the value “World”
BTW, You should probably have a Redis instance running...
Visiting http://localhost/redis/flushdb will destory your redis data in the first database. All of it. Without ever asking for any kind of confirmation.
Visiting http://localhost/redis/flashall will destory all your redis data. All of it. Without ever asking for any kind of confirmation.
All of Redis methods are supported. So you can use for example
http://localhost/redis/info to monitor your redis server
you can set the redis host and port with
$redishttp= new RedisHTTP(‘localhost, 6379);
Note: there is no state on the server side. So each command you send is a new connection; This is mostly important so you understand: No piping, and select will basically do nothing
Below is a simple ajax form that sends commands to redis and shows the result seperate the commands and the parameters by a forward slash
examples (just type this in the input box below):
Fork happily on https://github.com/AF83/redishttp