forked from iron-io/iron_cache_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestCache.php
49 lines (34 loc) · 975 Bytes
/
TestCache.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
#require "iron_cache.phar";
require("../iron_core_php/IronCore.class.php");
require("IronCache.class.php");
$cache = new IronCache();
$cache->ssl_verifypeer = false;
#$cache->debug_enabled = true;
$cache->setCacheName('cache #4');
for ($i = 0; $i < 10; $i++){
$key = "key ##$i";
echo "Put item on cache:\n";
$res = $cache->put($key, 777);
var_dump($res);
echo "\nGet item from cache:\n";
$item = $cache->get($key);
var_dump($item);
echo "Increment item on cache:\n";
$res = $cache->increment($key, -222);
var_dump($res);
echo "\nGet item from cache:\n";
$item = $cache->get($key);
var_dump($item);
echo "\nRemoving item from cache:\n";
$res = $cache->delete($key);
var_dump($res);
echo "\nGet item from cache:\n";
$item = $cache->get($key);
var_dump($item);
echo "\nClear cache:\n";
$res = $cache->clear();
var_dump($res);
echo "----$i----\n";
}
echo "\n done";