regeda / nest
Nest is a decorator for key based methods invocation
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/regeda/nest
Requires
- php: >=5.3
This package is not auto-updated.
Last update: 2025-10-06 15:34:34 UTC
README
Nest is a decorator for key based methods invocation. The class for PHP 5.3 consists of just one file.
Usage
Defining the initial namespace and the client:
$nest = new Nest('foo', new Redis()); echo $nest; // -> foo
Extending the namespace:
$nest = new Nest('foo', new Redis()); echo $nest['bar']; // -> foo:bar echo $nest['bar']['baz']; // -> foo:bar:baz
Invoking a method:
$redis = new Redis(); // or $memcached = new Memcached() $user = new Nest('user', $redis); // getter foreach ($ids as $id) { echo $user[$id]['username']->get(); // makes the proxy to $redis->get('user:$id:username') } // setter $user[$id]['age']->set(18); // $redis->set('user:$id:age', 18)