initphp/redis 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

initphp/redis

最新稳定版本:1.0

Composer 安装命令:

composer require initphp/redis

包简介

InitPHP Redis Management

README 文档

README

This library was born to facilitate and customize the use of getter and setter of PHP and Redis.

Requirements

  • PHP 7.4 or later
  • PHP Redis Extension

Installation

composer require initphp/redis

Usage

require_once "vendor/autoload.php";
use \InitPHP\Redis\Redis;

// Provide your connection information;
$redis = new Redis([
        'prefix'        => 'i_',
        'host'          => '127.0.0.1',
        'password'      => null,
        'port'          => 6379,
        'timeout'       => 0,
        'database'      => 0,
]);

// Use Setter and Getter;
$redis->set('name', 'muhammet');
if($redis->has('name')){
    echo $redis->get('name'); // "muhammet"
}

/**
 * or tell the get method what it will 
 * do if it can't find it, 
 * or a default value it will return;
 */
echo $redis->get('username', 'Undefined'); // "Undefined"

echo $redis->get('surname', function () use ($redis) {
    $value = 'ŞAFAK';
    $redis->set('surname', $value);
    return $value;
}); // "ŞAFAK"

Credits

License

Copyright © 2022 MIT License

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固