line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::t::Driver::CacheCache; |
2
|
|
|
|
|
|
|
$CHI::t::Driver::CacheCache::VERSION = '0.59'; |
3
|
1
|
|
|
1
|
|
506
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
291
|
use CHI::Test; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use File::Temp qw(tempdir); |
7
|
|
|
|
|
|
|
use base qw(CHI::t::Driver); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $root_dir; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub supports_expires_on_backend { 1 } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub required_modules { |
14
|
|
|
|
|
|
|
return { 'Cache::Cache' => undef, 'Cache::FileCache' => undef }; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new_cache_options { |
18
|
|
|
|
|
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$root_dir ||= |
21
|
|
|
|
|
|
|
tempdir( "chi-driver-cachecache-XXXX", TMPDIR => 1, CLEANUP => 1 ); |
22
|
|
|
|
|
|
|
return ( |
23
|
|
|
|
|
|
|
$self->SUPER::new_cache_options(), |
24
|
|
|
|
|
|
|
cc_class => 'Cache::FileCache', |
25
|
|
|
|
|
|
|
cc_options => { cache_root => $root_dir } |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub set_standard_keys_and_values { |
30
|
|
|
|
|
|
|
my ($self) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my ( $keys, $values ) = $self->SUPER::set_standard_keys_and_values(); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Cache::FileCache apparently cannot handle key = 0 |
35
|
|
|
|
|
|
|
$keys->{'zero'} = 'zero'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return ( $keys, $values ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# Skip multiple process test - Cache::FileCache will hit occasional rename failures under this test |
41
|
|
|
|
|
|
|
sub test_multiple_procs { } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |