Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
Cache_Lite::Cache_Lite_Function (drop() method)
3
--FILE--
4
<?php
5
 
6
require_once('callcache.inc');
7
require_once('tmpdir.inc');
8
require_once('cache_lite_function_base.inc');
9
 
10
$options = array(
11
    'cacheDir' => tmpDir() . '/',
12
    'lifeTime' => 60
13
);
14
$foo = 10;
15
 
16
$cache = new Cache_Lite_Function($options);
17
 
18
$data = $cache->call('function_to_bench', 23, 66);
19
echo($data."\n");
20
$data = $cache->call('function_to_bench', 23, 66);
21
echo($data."\n");
22
$cache->drop('function_to_bench', 23, 66);
23
$data = $cache->call('function_to_bench', 23, 66);
24
echo($data."\n");
25
$data = $cache->call('function_to_bench', 23, 66);
26
echo($data."\n");
27
$cache->clean();
28
 
29
function function_to_bench($arg1, $arg2)
30
{
31
    global $foo;
32
    $foo = $foo + 1;
33
    echo "hello !\n";
34
    return($foo + $arg1 + $arg2);
35
}
36
 
37
?>
38
--GET--
39
--POST--
40
--EXPECT--
41
hello !
42
100
43
hello !
44
100
45
hello !
46
101
47
hello !
48
101