PHP code example of not-empty / database-cache-php-lib

1. Go to this page and download the library: Download not-empty/database-cache-php-lib 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/ */

    

not-empty / database-cache-php-lib example snippets


use DatabaseCache\Repository;
$redisConfig = [
    'host' => 'localhost',
    'port' => 6379,
];
$repository = new Repository($redisConfig);
$data = [
    'name' => 'gabriel',
    'email' => '[email protected]',
];
$repository->setQuery(
    'table:id',
    json_encode($data)
);
$getData = $repository->getQuery('table:id');
var_dump($data);
sh
php sample/repository-sample.php