https://github.com/limingxinleo/x-redis
Redis 单例工厂类
https://github.com/limingxinleo/x-redis
redis redis-client
Last synced: 4 months ago
JSON representation
Redis 单例工厂类
- Host: GitHub
- URL: https://github.com/limingxinleo/x-redis
- Owner: limingxinleo
- License: mit
- Created: 2017-09-22T00:36:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T02:44:00.000Z (about 7 years ago)
- Last Synced: 2025-03-19T06:43:03.865Z (4 months ago)
- Topics: redis, redis-client
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# X-Redis
[](https://travis-ci.org/limingxinleo/x-redis)
## 安装
~~~
composer require limingxinleo/x-redis
~~~## 使用
~~~php
set('key','val');
echo $redis->get('key'); // val
~~~## 使用LuaCommand
~~~php
key, 5, 3600);
$redis = Redis::getInstance();
$res = $redis->evaluate($command->getScript(), $command->getArguments(), $command->getNumKeys());
echo $res; // 5
$time = $redis->ttl($this->key);
echo $time; // 3600sleep(1);
$res = $redis->evaluate($command->getScript(), $command->getArguments(), $command->getNumKeys());
echo $res; // 10
$time = $redis->ttl($this->key);
echo $time; // 3599
~~~