PHP code example of ublaboo / predis-client-nette-extension

1. Go to this page and download the library: Download ublaboo/predis-client-nette-extension 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/ */

    

ublaboo / predis-client-nette-extension example snippets




declare(strict_types=1);

use Predis\Client;

class Foo
{

	/**
	 * @var Client
	 */
	public $redisClient;


	public function __construct(Client $redisClient)
	{
		$this->redisClient = $redisClient;
	}


	public function save(string $key, string $value): void
	{
		$this->redisClient->set($key, $value);
	}
	
	
	public function retrive(string $key): ?string
	{
		return $this->redisClient->get($key);
	}

}