greezen / redis-pagination
paginate with redis sorted set
v1.0.0
2022-10-19 01:55 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-03-20 07:08:02 UTC
README
Install
composer require greezen/redis-pagination
Examples
Add
$items = array(array('score' => 1, 'value' => 'test')); $redisPagination = new greezen\RedisPagination($redis); $redisPagination->setKey('list')->insert($items, 60);
Get
$redisPagination = new greezen\RedisPagination($redis); $redisPagination->setKey('list')->paginate(1, 20); $redisPagination->setKey('list')->offset(0)->limit(20)->order('desc')->get() $redisPagination->setKey('list')->first(); $redisPagination->setKey('list')->last();
Remove
$redisPagination = new greezen\RedisPagination($redis); $redisPagination->setKey('list')->delete();