/home/techb158/ileadtechnology.com/vendor/predis/predis/examples
NameSizeModeActions
custom_cluster_distributor.php28010644editdlrm
debuggable_connection.php23520644editdlrm
dispatcher_loop.php21660644editdlrm
executing_redis_commands.php14640644editdlrm
key_prefixing.php8910644editdlrm
lua_scripting_abstraction.php17210644editdlrm
monitor_consumer.php15730644editdlrm
pipelining_commands.php10060644editdlrm
pubsub_consumer.php20330644editdlrm
redis_collections_iterators.php28120644editdlrm
replication_complex.php26170644editdlrm
replication_sentinel.php21620644editdlrm
replication_simple.php17670644editdlrm
session_handler.php18930644editdlrm
shared.php10250644editdlrm
transaction_using_cas.php15420644editdlrm
Edit: /home/techb158/ileadtechnology.com/vendor/predis/predis/examples/executing_redis_commands.php (1464B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require __DIR__.'/shared.php'; $client = new Predis\Client($single_server); // Plain old SET and GET example... $client->set('library', 'predis'); $response = $client->get('library'); var_export($response); echo PHP_EOL; /* OUTPUT: 'predis' */ // Redis has the MSET and MGET commands to set or get multiple keys in one go, // cases like this Predis accepts arguments for variadic commands both as a list // of arguments or an array containing all of the keys and/or values. $mkv = array( 'uid:0001' => '1st user', 'uid:0002' => '2nd user', 'uid:0003' => '3rd user', ); $client->mset($mkv); $response = $client->mget(array_keys($mkv)); var_export($response); echo PHP_EOL; /* OUTPUT: array ( 0 => '1st user', 1 => '2nd user', 2 => '3rd user', ) */ // Predis can also send "raw" commands to Redis. The difference between sending // commands to Redis the usual way and the "raw" way is that in the latter case // their arguments are not filtered nor responses coming from Redis are parsed. $response = $client->executeRaw(array( 'MGET', 'uid:0001', 'uid:0002', 'uid:0003', )); var_export($response); echo PHP_EOL; /* OUTPUT: array ( 0 => '1st user', 1 => '2nd user', 2 => '3rd user', ) */