forked from haohailuo/php-file-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
29 lines (22 loc) · 762 Bytes
/
test.php
File metadata and controls
29 lines (22 loc) · 762 Bytes
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
<?php
require_once('fcache.inc.php');
//example
$cache = new FCache();
$storeData = array(
'time' => time(),
'str' => 'test',
'int' => 1321
);
$cache->add('select * from table;', $storeData);
$cache->add('select * from table;', $storeData);
$cache->add('select * from table;', $storeData);
$cache->add('select * from table;', $storeData);
print_r($storeData = $cache->get('select * from table;'));
$cache->delete('select * from table;');
print_r ($cache->get('select * from table;') ? 'exist': 'has no cache');
$cache->add('select * from table1;', 123);
$cache->add('select * from table2;', 234);
$cache->add('select * from table3;', 345);
$cache->flush();
print_r ($cache->get('select * from table3;') ? 'exist': 'has no cache');
?>