PHP Classes

File: sample/repository-sample.php

Recommend this page to a friend!
  Classes of Leonardo Di Sarli   PHP Cache Database Results Library   sample/repository-sample.php   Download  
File: sample/repository-sample.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Cache Database Results Library
Cache database query results in a Redis server
Author: By
Last change:
Date: 8 months ago
Size: 423 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__ . '/../vendor/autoload.php';

use
DatabaseCache\Repository;

$redisConfig = [
   
'host' => 'localhost',
   
'port' => 6379,
];

$repository = new Repository($redisConfig);
$data = [
   
'name' => 'gabriel',
   
'email' => 'testegabs@teste.com',
];
$repository->setQuery(
   
'table:id',
   
json_encode($data)
);

$getData = $repository->getQuery('table:id');

print_r($getData);
echo
PHP_EOL;