add random things for redis
This commit is contained in:
parent
cfaaccea5e
commit
3c868d4bd7
27
checkers/php-redis.php
Normal file
27
checkers/php-redis.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
|
use Predis\Client as PredisClient;
|
||||||
|
|
||||||
|
$r = new PredisClient([
|
||||||
|
'scheme' => 'tcp',
|
||||||
|
'host' => '90.156.203.247',
|
||||||
|
'port' => 6379,
|
||||||
|
'password' => 'Ir3Roovu',
|
||||||
|
'database' => 15,
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
$r->hset('user-session:123', 'name', 'John');
|
||||||
|
$r->hset('user-session:123', 'surname', 'Smith');
|
||||||
|
$r->hset('user-session:123', 'company', 'Redis');
|
||||||
|
$r->hset('user-session:123', 'age', 29);
|
||||||
|
echo var_export($r->hgetall('user-session:123')), PHP_EOL;
|
||||||
|
|
||||||
|
|
||||||
|
echo $r->set('foo', 'bar'), PHP_EOL;
|
||||||
|
// >>> OK
|
||||||
|
|
||||||
|
echo $r->get('foo'), PHP_EOL;
|
||||||
|
// >>> bar
|
||||||
Loading…
x
Reference in New Issue
Block a user