tfhinc/ci-realredis

真的Redis! - RealRedis 是 Codeigniter 框架中 phpredis 的包装库。

v1.1.9 2018-12-04 03:34 UTC

This package is not auto-updated.

Last update: 2024-10-03 06:10:39 UTC


README

Latest Version on Packagist PHP Version Software License Total Downloads

真的Redis! - RealRedis 是 Codeigniter 框架中 Codeigniter 中 phpredis 的包装库。

要求

  • PHP >= 7.1.0
  • phpredis
  • CodeIgnitor 3.x

安装

通过 composer 安装库

composer require tfhinc/ci-realredis

运行安装后命令以将辅助文件和类文件发布到适当的 CI 目录

composer --working-dir=vendor/tfhinc/ci-realredis/ run-script publish-files

加载库

加载 RealRedis 库有一些可用选项

使用 realredis() 辅助函数

RealRedis 辅助函数将通过 CI 实例解析 RealRedis 类。它将加载类或返回现有的类实例

$this->load->helper('realredis');

使用 RealRedis 类

在需要时可以实例化 RealRedis 类

$redis = new TFHInc/RealRedis/RealRedis();

使用 RealRedis CI 库

在需要时可以实例化 RealRedis 类

$this->load->library('RealRedis');

用法

// Use the helper method

$this->CI->load->helper('realredis');

realredis()->get('sample.key');

// Use the RealRedis class

$realredis = new TFHInc\RealRedis\RealRedis();

$realredis->get('sample.key');

// Use the RealRedis CI Library

$this->load->library('RealRedis');

$realredis->get('sample.key');

贡献

请随意创建 GitHub 问题或发送带有任何错误修复的 pull 请求。有关需要帮助的问题,请参阅 GutHub 问题跟踪器。

致谢

许可协议

MIT 许可协议 (MIT)。有关更多信息,请参阅 许可文件