diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-07 20:31:11 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-07 20:31:11 +0100 |
commit | 378a912bf79e1e5b6384b02b14919371ac0c4785 (patch) | |
tree | a7969b83c550188e093ac7e5b4aa5a6542908fd5 /lib/LXRng/Cached.pm | |
parent | f5277f0a49bfb6eb48c27de4d644b2f9e2f94e4f (diff) |
Provisions for mod_perl use, take one.
Diffstat (limited to 'lib/LXRng/Cached.pm')
-rw-r--r-- | lib/LXRng/Cached.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/LXRng/Cached.pm b/lib/LXRng/Cached.pm index 9c30d82..f27d3c2 100644 --- a/lib/LXRng/Cached.pm +++ b/lib/LXRng/Cached.pm @@ -1,6 +1,8 @@ package LXRng::Cached; use strict; +use LXRng; + require Exporter; use vars qw($memcached @ISA @EXPORT); @ISA = qw(Exporter); @@ -12,9 +14,11 @@ BEGIN { require Digest::SHA1; }; if ($@ eq '') { + my $nspace = substr(Digest::SHA1::sha1_hex($LXRng::ROOT), 0, 8); + $memcached = Cache::Memcached->new({ 'servers' => ['127.0.0.1:11211'], - 'namespace' => 'lxrng'}); + 'namespace' => 'lxrng:$nspace'}); $memcached = undef unless ($memcached->set(':caching' => 1)) } |