dawen / phpredis-bundle
Symfony2 的 PhpRedis 扩展包
v0.5.1
2015-12-11 09:01 UTC
Requires
- php: >=5.3.3
- symfony/framework-bundle: ~2.3|~3.0
- symfony/yaml: ~2.3|~3.0
Requires (Dev)
- symfony/console: ~2.1|~3.0
Suggests
- symfony/console: If you want to use commands to interact with the redis database. (planned)
This package is not auto-updated.
Last update: 2024-09-20 21:17:08 UTC
README
Symfony 2 Bundle for phpredis extension
!!!警告
此扩展包正在开发中。强烈建议不要在生产环境中使用此扩展包
工作方法
- hashes: hDel, hExists, hGet, hGetAll, hIncrBy, hIncrByFloat, hKeys, hLen, hMGet, hMSet, hSet
- keys: del, dump, exists, expire, expireAt, keys, move, object, persist, randomKey, rename, renameNx, type, sort, ttl, restore
- lists: brPop, blPop, brPoplPush, lGet, lGetRange, lInsert, lLen, lIndex, lPush, lPushx, lRange, lRem, lRemove, lSet, lSize, lTrim, ListTrim, rPop, rPopLPush, rPush, rPushx
- sets: sAdd, sCard, sContains, sDiff, sDiffStore, sGetMembers, sInter, sInterStore, sIsMember, sMembers, sMove, sPop, sRandMember, sRem, sRemove, sSize, sUnion, sUnionStore
- sorted sets: zAdd, zCard, zCount, zIncrBy, zInter, zRange, zRangeByScore, zRevRangeByScore, zRank, zRevRank, zSize
- strings: append, bitCount, decr, get, getBit, getRange, getSet, incr, incrByFloat, mget, mset, set, setBit, setex, setnx, setRange, strlen
- server: bgrewriteaof, bgsave, config, dbSize, flushAll, flushDB, info, lastSave, resetStat, save, slaveOf, time, slowlog
- connection: auth, close, echo (cEcho), getOption, ping, select, setOption
缺少集成测试
- keys: sort (等待 sadd 函数)
- lists: blPop, brPop,
- server: resetStats, slaveOf
忽略的方法
- connection: connect, pconnect, open, popen
- strings: delete, incrBy, decrBy, getMultiple, mSetNx, psetex
- keys: getKeys, setTimeout, pexpire, pexpireAt, renameKey, pttl
不工作的方法
- strings: bitOp
- keys: migrate
方法信息
- set: 参数超时在 docbloc 和函数中定义为 float。它是一个 int 或 long。Float 会引发错误
- bitOf: 总是返回 0
- migrate: 成功时返回 false
- lTrim: listTrim: 返回值被注释为数组。将返回 bool 值
- lPush: 如果可选参数为 null,它将插入空白字符串
- rPush: 如果可选参数为 null,它将插入空白字符串
- sDiff: 第三个参数似乎被忽略
- sDiffStore: 第三个参数似乎被忽略
- sInter: 第三个参数似乎被忽略
- sInterStore: 第三个参数似乎被忽略
- zInter: outKey 未存储,weight 不起作用
配置
以下是一个配置示例
注意日志标志。当您在生产系统上运行许多 Redis 命令且启用了日志记录时,可能会遇到内存限制超过错误。Redis 客户端日志记录器正在收集每个命令到数据收集器中。
config.yml
php_redis:
clients:
default:
host: localhost
port: ~
db: 0
pconnect: true
logging: true
connection_timeout: 1
importstatus:
host: localhost
port: ~
db: 1
pconnect: true
logging: true
Symfony2 内部测试
要运行单元测试和集成测试,请向您的配置添加测试参数:config_test.yml
parameters:
redis:
host: localhost
port: 6379
db: 10
db2: 9
请记住,您必须运行自己的 Redis 服务器。
信息 测试中将执行 flushAll 命令。最好为测试运行自己的实例