File: Memcached.pm

package info (click to toggle)
libapache-session-memcached-perl 0.03-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 136 kB
  • sloc: perl: 82; makefile: 15
file content (100 lines) | stat: -rw-r--r-- 2,528 bytes parent folder | download | duplicates (3)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package Apache::Session::Memcached;

use strict;
use vars qw($VERSION);
$VERSION = '0.03';

use base qw(Apache::Session);

use Apache::Session::Generate::MD5;
use Apache::Session::Lock::Null;
use Apache::Session::Serialize::Storable;
use Apache::Session::Store::Memcached;

sub populate {
	my $self = shift;
	$self->{object_store} = Apache::Session::Store::Memcached->new($self);
	$self->{lock_manager} = Apache::Session::Lock::Null->new($self);
	$self->{generate}     = \&Apache::Session::Generate::MD5::generate;
	$self->{validate}     = \&Apache::Session::Generate::MD5::validate;
	$self->{serialize}    = \&Apache::Session::Serialize::Storable::serialize;
	$self->{unserialize}  = \&Apache::Session::Serialize::Storable::unserialize;
	return $self;
}

1;
__END__

=head1 NAME

Apache::Session::Memcached - Stores persistent data using memcached (memory
cache daemon) for Apache::Session storage

=head1 SYNOPSIS

   use Apache::Session::Memcached;
   tie %session, 'Apache::Session::Memcached', $sid, {
      Servers => '10.0.0.1:20000 10.0.0.2:20000',
      NoRehash => 1,
      Readonly => 0,
      Debug => 1,
      CompressThreshold => 10_000
   };

=head1 DESCRIPTION

Apache::Session::Memcached is a bridge between Apache::Session and
memcached, a distributed memory cache daemon.

More information about memcached is available at
L<http://www.danga.com/memcached>.

This module provides a way to use Cache::Memcached (memcached Perl API) as
Apache::Session storage implementation.

=head1 INSTALLATION

In order to install and use this package you will need Perl version 5.005 or
better.

Prerequisites:

=over 4

=item * Apache::Session >= 1.54

=item * Cache::Memcached >= 1.14

=back

Installation as usual:

   %> perl Makefile.PL
   %> make
   %> make test
   %> make install

Note: for live tests, you must run at least a memcached daemon and you could
need to edit t/CONFIG file, in order to set correct parameters used for
testing. 

=head1 SEE ALSO

L<Apache::Session::Store::Memcached|Apache::Session::Store::Memcached>,
L<Apache::Session|Apache::Session>,
L<Apache::Session::Flex|Apache::Session::Flex>,
L<Cache::Memcached|Cache::Memcached>, L<memcached>.

=head1 AUTHOR

Enrico Sorcinelli E<lt>enrico at sorcinelliE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2004 by Enrico Sorcinelli

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.1 or,
at your option, any later version of Perl 5 you may have available.

=cut