add:封装通用的获取redis实例的logic
This commit is contained in:
parent
70ece3ed15
commit
8f3c044f41
14
app/common/logic/RedisLogic.php
Normal file
14
app/common/logic/RedisLogic.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\logic;
|
||||||
|
|
||||||
|
class RedisLogic extends BaseLogic
|
||||||
|
{
|
||||||
|
public static function getInstance()
|
||||||
|
{
|
||||||
|
$redisInstance = new \Redis();
|
||||||
|
$redisInstance->connect(env('redis.host'));
|
||||||
|
$redisInstance->auth(env('redis.auth'));
|
||||||
|
return $redisInstance;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user