burgov/predis-wrapper
Composer 安装命令:
composer require burgov/predis-wrapper
包简介
A set of helper classes around Predis
README 文档
README
A set of helper classes around the Predis library
$client = new Burgov\PredisWrapper\Client(new Predis\Client(/* ... */)); $string = new Scalar($client, 'string_key'); $set = new Set($client, 'set_key'); $sortedSet = new SortedSet($client, 'sorted_set_key'); $hash = new Hash($client, 'hash_key'); $list = new PList($client, 'list_key'); // unfortunately, "list" is a reserved word in PHP
Or use the factory:
$factory = new TypeFactory($client); // when you're sure "some_key" exists. This will return an instance of the appropriate class $factory->instantiate('some_key'); // when you're expecting "some_set_key" to be a set or non existent. Will throw exception if it is something else. $factory->instantiateSet('some_set_key');
$factory will always try to return the same instance of a type based on the key
See usage examples in the integration tests:
Here is a list of all the redis commands that are wrapped (so far): Wrapped commands
统计信息
- 总下载量: 451
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-10-27