src/Leevel/Cache/Redis/PhpRedis.php
public function set(string $name, $data, ?int $expire = null): void
    {
        if ($expire) {
            $this->handle->setex($name, $expire, $data);
        } else {
            $this->handle->set($name, $data);
        }
    }
public function set(string $name, $data, ?int $expire = null): void
    {
        if ($expire) {
            $this->handle->setex($name, $expire, $data);
        } else {
            $this->handle->set($name, $data);
        }
    }
设置缓存.

@param string $name
@param mixed  $data
@param int    $expire