PHP code example of merexo / rediska

1. Go to this page and download the library: Download merexo/rediska library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

merexo / rediska example snippets


$client = new \Merexo\Rediska\Client(null, null); // try to take params from .env 

$client = new \Merexo\Rediska\Client;
$client->cache()->set('key', 'my_value');

echo $client->cache()->get('key');

...

$stream = $client->stream('stream_key');
$key = $stream->add(['key' => 'value', 'object' => new \StdClass]);

print_r($stream->get($key)); // response: ['key' => 'value', 'object' => new \StdClass]

$stream->flush();