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

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

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

arefshojaei/redis

Composer 安装命令:

composer require arefshojaei/redis

包简介

A memory database with key & value

README 文档

README

A memory database with key & value

Installation

Using Composer

composer require arefshojaei/redis

Using Github

git clone https://github.com/ArefShojaei/Redis.git

How to use that?

1- Run in Terminal (CLI)

# First method:
php bin/redis-cli

# Second method:
chmod +x ./bin/redis-cli
./bin/redis-cli

2- Run as Live-server to explore data in page

# First method:
php bin/redis-server

# Second method:
chmod +x ./bin/redis-server
./bin/redis-server

Commands:

String

Set value by key

set [key] [value]

Get value by key

get [key]

Set & Get value by key

getSet [key] [value]

Get string length

strlen [key]

Set multiple values

mset [key=value] [key=value] [key=value] [...]

Get multiple values

mset [key-1] [key-2] [key-3] [key-n]

Append value to string

set message Hello

append message World # HelloWorld

Get range of string from start to end by index

set message Hello

getRange message 0 1 # He

Delete value by key

del [key]

Delete multiple values by keys

unlink [key-1] [key-2] [key-3] [key-n]

Set expire-time for string

setex [key] [seconds] [value]

Get current expire-time seconds to delete the value

setex [key]

Check to exist value by key

exists [key]

Number

Increment number by key

set counter 5 # Init state

incr counter # Update the state => 5+1 = 6

Decrement number by key

set counter 5 # Init state

decr counter # Update the state => 5-1 = 4

Increment number with value

set counter 5 # Init state

incrBy counter 10 # Update the state => 5+10 = 15

Decrement number with value

set counter 5 # Init state

decrBy counter 5 # Update the state => 5-5 = 0

Hash

Set new hash

hset [name] [key] [value]

Set multiple hash data by key & value

hmset [name] [key:value] [key:value] [...]

Get hash value by key

hget [name] [key]

Get all hash data

hgetall [name]

Get hash length

hlen [name]

Get all hash keys

hkeys [name]

Get all hash values

hvals [name]

Get multiple hash values by keys

hvals [name] [key-1] [key-2] [key-3] [key-n]

Delete hash value by key

hdel [name] [key]

Check to exist hash value by key

hexists [name] [key]

List

Push values to list

lpush [name] [value]

Pop value from the list by name

lpop [name]

Get length of list by name

llen [name]

Get value of list by index

llen [name] [index]

Get range of list from start to end by name

llen [name] [start] [end]

Remove value of list by index

lrem [name] [index]

Set key & value to list by name

lset [name] [key] [value]

Remove value of list at end of list

Rpop [name]

Add new value of list at end of list

Rpush [name] [value]

Store

Get store

dump

Get all store keys

keys

Destroy the store

flushdb

Session

Terminate current session

quit

General

FUN!

ping

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固