burgov/predis-wrapper

围绕 Predis 的一系列辅助类

1.1.0 2014-03-18 13:29 UTC

This package is not auto-updated.

Last update: 2024-09-23 16:26:44 UTC


README

Build Status Coverage Status

围绕 Predis 库的一系列辅助类

$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

或使用工厂

$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 总是会根据键尝试返回相同类型的实例

请在集成测试中的使用示例中查看

以下是所有被包装的 redis 命令列表(目前): 包装命令