touhonoob/RateLimit

Allow to instantiate RedisAdapter with connected Redis client

sc0rp10 opened this issue · 0 comments

Now if I have already configured and connected Redis client, I need to create new and connect at RateLimitAdapterRedis
My idea is using prepared and connected Redis client such as:

$redis = new Redis();
$redis->pconnect('1.2.3.4', 6379);

$adapter = new RateLimitAdapterRedis($redis);
$rateLimit = new RateLimit("myratelimit", 100, 3600, $adapter);

@touhonoob what do you think about it? I can PR this, if you need.