Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/limingxinleo/x-redis
Redis 单例工厂类
https://github.com/limingxinleo/x-redis
redis redis-client
Last synced: 3 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T02:44:00.000Z (over 6 years ago)
- Last Synced: 2024-05-05T03:43:09.864Z (9 months ago)
- Topics: redis, redis-client
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# X-Redis
[![Build Status](https://travis-ci.org/limingxinleo/x-redis.svg?branch=master)](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
~~~