Files
hyperf_rbac_framework_serve…/app/Cache/Redis/RedisProxyWrapper.php

31 lines
708 B
PHP

<?php
namespace App\Cache\Redis;
use Hyperf\Redis\RedisProxy;
class RedisProxyWrapper
{
public function __construct(
protected readonly RedisProxy $redisProxy,
protected string $poolName
) {}
/**
* @param string $method
* @param array $arguments
* @return mixed
*/
public function __call(string $method, array $arguments)
{
return $this->redisProxy->{$method}(...$arguments);
}
public function lua(string $scriptClass)
{
// 这里实现你的 Lua 脚本逻辑
$key = $this->poolName . ':' . $scriptClass;
// 实际实现根据你的需求
return $this->redisProxy->eval($scriptClass, 0);
}
}