Files
juipphp/extends/redis/Redisop.php
“wanyongkang” a2fb12bf71 短信验证
2022-05-13 17:30:16 +08:00

30 lines
586 B
PHP

<?php
namespace extend\redis;
class Redisop {
private $redis;
public function __construct()
{
$this->redis = new \Redis();
$this->redis->connect('127.0.0.1', 6379);
$this->redis->auth('123456');
}
public function setOfTime($key = '', $value = '') {
if (empty($key)) {
die;
}
$this->redis->set( $key , $value);
$this->redis->expire($key,120);
}
public function get($key = '') {
if (empty($key)) {
die;
}
return $this->redis->get( $key );
}
}