| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | ############################################################################# | 
| 2 |  |  |  |  |  |  | # | 
| 3 |  |  |  |  |  |  | # Apache::Session::File | 
| 4 |  |  |  |  |  |  | # Apache persistent user sessions in the filesystem | 
| 5 |  |  |  |  |  |  | # Copyright(c) 1998, 1999, 2000 Jeffrey William Baker (jwbaker@acm.org) | 
| 6 |  |  |  |  |  |  | # Distribute under the Artistic License | 
| 7 |  |  |  |  |  |  | # | 
| 8 |  |  |  |  |  |  | ############################################################################ | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | package Apache::Session::File; | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 1 |  |  | 1 |  | 1636 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 52 |  | 
| 13 | 1 |  |  | 1 |  | 8 | use vars qw(@ISA $VERSION); | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 98 |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | $VERSION = '1.54'; | 
| 16 |  |  |  |  |  |  | @ISA = qw(Apache::Session); | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 1 |  |  | 1 |  | 487 | use Apache::Session; | 
|  | 1 |  |  |  |  | 4 |  | 
|  | 1 |  |  |  |  | 46 |  | 
| 19 | 1 |  |  | 1 |  | 583 | use Apache::Session::Lock::File; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 48 |  | 
| 20 | 1 |  |  | 1 |  | 505 | use Apache::Session::Store::File; | 
|  | 1 |  |  |  |  | 4 |  | 
|  | 1 |  |  |  |  | 40 |  | 
| 21 | 1 |  |  | 1 |  | 525 | use Apache::Session::Generate::MD5; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 44 |  | 
| 22 | 1 |  |  | 1 |  | 501 | use Apache::Session::Serialize::Storable; | 
|  | 1 |  |  |  |  | 5 |  | 
|  | 1 |  |  |  |  | 207 |  | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | sub populate { | 
| 25 | 3 |  |  | 3 | 0 | 4 | my $self = shift; | 
| 26 |  |  |  |  |  |  |  | 
| 27 | 3 |  |  |  |  | 21 | $self->{object_store} = new Apache::Session::Store::File $self; | 
| 28 | 3 |  |  |  |  | 18 | $self->{lock_manager} = new Apache::Session::Lock::File $self; | 
| 29 | 3 |  |  |  |  | 6 | $self->{generate}     = \&Apache::Session::Generate::MD5::generate; | 
| 30 | 3 |  |  |  |  | 8 | $self->{validate}     = \&Apache::Session::Generate::MD5::validate; | 
| 31 | 3 |  |  |  |  | 4 | $self->{serialize}    = \&Apache::Session::Serialize::Storable::serialize; | 
| 32 | 3 |  |  |  |  | 6 | $self->{unserialize}  = \&Apache::Session::Serialize::Storable::unserialize; | 
| 33 |  |  |  |  |  |  |  | 
| 34 | 3 |  |  |  |  | 6 | return $self; | 
| 35 |  |  |  |  |  |  | } | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | sub DESTROY { | 
| 38 | 3 |  |  | 3 |  | 22 | my $self = shift; | 
| 39 |  |  |  |  |  |  |  | 
| 40 | 3 |  |  |  |  | 11 | $self->save; | 
| 41 | 3 |  |  |  |  | 12 | $self->{object_store}->close; | 
| 42 | 3 |  |  |  |  | 14 | $self->release_all_locks; | 
| 43 |  |  |  |  |  |  | } | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | 1; | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | =pod | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | =head1 NAME | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | Apache::Session::File - An implementation of Apache::Session | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | use Apache::Session::File; | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | tie %hash, 'Apache::Session::File', $id, { | 
| 59 |  |  |  |  |  |  | Directory => '/tmp/sessions', | 
| 60 |  |  |  |  |  |  | LockDirectory   => '/var/lock/sessions', | 
| 61 |  |  |  |  |  |  | }; | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | This module is an implementation of Apache::Session.  It uses the File backing | 
| 66 |  |  |  |  |  |  | store and the File locking scheme.  You must specify the directory for the | 
| 67 |  |  |  |  |  |  | object store and the directory for locking in arguments to the constructor. See | 
| 68 |  |  |  |  |  |  | the example, and the documentation for Apache::Session::Store::File and | 
| 69 |  |  |  |  |  |  | Apache::Session::Lock::File. | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | =head1 AUTHOR | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | This module was written by Jeffrey William Baker . | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | L, L, | 
| 78 |  |  |  |  |  |  | L, L, L |