Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/limingxinleo/x-redis

Redis 单例工厂类
https://github.com/limingxinleo/x-redis

redis redis-client

Last synced: 3 months ago
JSON representation

Redis 单例工厂类

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; // 3600

sleep(1);

$res = $redis->evaluate($command->getScript(), $command->getArguments(), $command->getNumKeys());
echo $res; // 10
$time = $redis->ttl($this->key);
echo $time; // 3599
~~~