Lines 49-60
use Carp;
Link Here
|
49 |
|
49 |
|
50 |
use base qw(Class::Accessor); |
50 |
use base qw(Class::Accessor); |
51 |
|
51 |
|
|
|
52 |
use vars qw($_cache_handler); |
53 |
|
52 |
use Koha::Cache::Memcached; |
54 |
use Koha::Cache::Memcached; |
53 |
|
55 |
|
54 |
__PACKAGE__->mk_ro_accessors( qw( cache ) ); |
56 |
__PACKAGE__->mk_ro_accessors( qw( cache ) ); |
55 |
|
57 |
|
56 |
sub new { |
58 |
sub new { |
57 |
my $class = shift; |
59 |
my $class = shift; |
|
|
60 |
return $_cache_handler if $_cache_handler; |
58 |
# my $param = shift; |
61 |
# my $param = shift; |
59 |
my $cache; |
62 |
my $cache; |
60 |
my $subclass; |
63 |
my $subclass; |
Lines 69-75
sub new {
Link Here
|
69 |
} |
72 |
} |
70 |
) |
73 |
) |
71 |
or croak "Cannot create cache handle for memcache"; |
74 |
or croak "Cannot create cache handle for memcache"; |
72 |
return bless $class->SUPER::new({cache => $cache}), $subclass; |
75 |
$_cache_handler = bless $class->SUPER::new({cache => $cache}), $subclass; |
|
|
76 |
return $_cache_handler; |
73 |
} else { |
77 |
} else { |
74 |
$ENV{DEBUG} && warn "No caching system"; |
78 |
$ENV{DEBUG} && warn "No caching system"; |
75 |
return; |
79 |
return; |
76 |
- |
|
|