mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
add redis wrapper
This commit is contained in:
@@ -15,6 +15,7 @@ use ZM\Store\Database\DBException;
|
||||
use ZM\Store\Database\DBQueryBuilder;
|
||||
use ZM\Store\Database\DBWrapper;
|
||||
use ZM\Store\KV\KVInterface;
|
||||
use ZM\Store\KV\Redis\RedisWrapper;
|
||||
|
||||
// 防止重复引用引发报错
|
||||
if (function_exists('zm_internal_errcode')) {
|
||||
@@ -216,6 +217,17 @@ function sql_builder(string $name = ''): DBQueryBuilder
|
||||
return (new DBWrapper($name))->createQueryBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Redis 操作类
|
||||
*
|
||||
* @param string $name 使用的 Redis 连接名称
|
||||
* @return RedisWrapper
|
||||
*/
|
||||
function redis(string $name = 'default'): RedisWrapper
|
||||
{
|
||||
return new RedisWrapper($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 / 设置配置项
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user