$r =& new Redis('localhost');
$r->connect();
+$r->select_db(9);
+$r->flushdb();
+echo "<pre>\n";
echo $r->ping() . "\n";
echo $r->do_echo('ECHO test') . "\n";
echo "SET aaa " . $r->set('aaa', 'bbb') . "\n";
echo 'KEYS a* ' . print_r($r->keys('a*'), true) . "\n";
echo 'RANDOMKEY ' . $r->randomkey('a*') . "\n";
echo 'RENAME a1 a0 ' . $r->rename('a1', 'a0') . "\n";
-echo 'RENAMENX a0 a2 ' . $r->rename('a0', 'a2', true) . "\n";
-echo 'RENAMENX a0 a1 ' . $r->rename('a0', 'a1', true) . "\n";
+echo 'RENAMENX a0 a2 ' . $r->renamenx('a0', 'a2') . "\n";
+echo 'RENAMENX a0 a1 ' . $r->renamenx('a0', 'a1') . "\n";
echo 'LPUSH a0 aaa ' . $r->push('a0', 'aaa') . "\n";
echo 'LPUSH a0 bbb ' . $r->push('a0', 'bbb') . "\n";
echo 'RPUSH a0 ccc ' . $r->push('a0', 'ccc', false) . "\n";
echo 'LLEN a0 ' . $r->llen('a0') . "\n";
echo 'LRANGE sdkjhfskdjfh 0 100 ' . print_r($r->lrange('sdkjhfskdjfh', 0, 100), true) . "\n";
-echo 'LRANGE a0 0 0 ' . print_r($r->lrange('sdkjhfskdjfh', 0, 0), true) . "\n";
+echo 'LRANGE a0 0 0 ' . print_r($r->lrange('a0', 0, 0), true) . "\n";
echo 'LRANGE a0 0 100 ' . print_r($r->lrange('a0', 0, 100), true) . "\n";
echo 'LTRIM a0 0 1 ' . $r->ltrim('a0', 0, 1) . "\n";
echo 'LRANGE a0 0 100 ' . print_r($r->lrange('a0', 0, 100), true) . "\n";
echo 'SINTER s0 s1 ' . print_r($r->sinter(array('s0', 's1')), true) . "\n";
echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
-echo 'SELECT 1 ' . $r->select_db(1) . "\n";
+echo 'SELECT 8 ' . $r->select_db(8) . "\n";
+echo 'EXISTS s1 ' . $r->exists('s1') . "\n";
+if ($r->exists('s1'))
+ echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
+echo 'SELECT 9 ' . $r->select_db(9) . "\n";
echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
-echo 'SELECT 0 ' . $r->select_db(0) . "\n";
+echo 'MOVE s1 8 ' . $r->move('s1', 8) . "\n";
+echo 'EXISTS s1 ' . $r->exists('s1') . "\n";
+if ($r->exists('s1'))
+ echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
+echo 'SELECT 8 ' . $r->select_db(8) . "\n";
echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
-echo 'MOVE s1 1 ' . $r->move('s1', 1) . "\n";
-echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
-echo 'SELECT 1 ' . $r->select_db(1) . "\n";
-echo 'SMEMBERS s1 ' . print_r($r->smembers('s1'), true) . "\n";
-echo 'SELECT 0 ' . $r->select_db(0) . "\n";
+echo 'SELECT 9 ' . $r->select_db(9) . "\n";
echo 'SAVE ' . $r->save() . "\n";
echo 'BGSAVE ' . $r->save(true) . "\n";
echo 'LASTSAVE ' . $r->lastsave() . "\n";
-?>
\ No newline at end of file
+echo 'INFO ' . print_r($r->info()) . "\n";
+echo "</pre>\n";
+?>