| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Apache::Session::SQLite3; | 
| 2 |  |  |  |  |  |  | $Apache::Session::SQLite3::VERSION = '0.03'; | 
| 3 |  |  |  |  |  |  |  | 
| 4 | 1 |  |  | 1 |  | 818 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 44 |  | 
| 5 | 1 |  |  | 1 |  | 6 | use base 'Apache::Session'; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 1156 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 1 |  |  | 1 |  | 3363 | use DBD::SQLite 1.00; | 
|  | 1 |  |  |  |  | 11588 |  | 
|  | 1 |  |  |  |  | 28 |  | 
| 8 | 1 |  |  | 1 |  | 8 | use Apache::Session; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 24 |  | 
| 9 | 1 |  |  | 1 |  | 866 | use Apache::Session::Lock::Null; | 
|  | 1 |  |  |  |  | 199 |  | 
|  | 1 |  |  |  |  | 29 |  | 
| 10 | 1 |  |  | 1 |  | 601 | use Apache::Session::Store::SQLite3; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 28 |  | 
| 11 | 1 |  |  | 1 |  | 908 | use Apache::Session::Generate::MD5; | 
|  | 1 |  |  |  |  | 318 |  | 
|  | 1 |  |  |  |  | 24 |  | 
| 12 | 1 |  |  | 1 |  | 789 | use Apache::Session::Serialize::Storable; | 
|  | 1 |  |  |  |  | 21266 |  | 
|  | 1 |  |  |  |  | 186 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | sub populate { | 
| 15 | 2 |  |  | 2 | 0 | 6728 | my $self = shift; | 
| 16 |  |  |  |  |  |  |  | 
| 17 | 2 |  |  |  |  | 23 | $self->{object_store} = Apache::Session::Store::SQLite3->new($self); | 
| 18 | 2 |  |  |  |  | 38 | $self->{lock_manager} = Apache::Session::Lock::Null->new($self); | 
| 19 | 2 |  |  |  |  | 170 | $self->{generate}     = \&Apache::Session::Generate::MD5::generate; | 
| 20 | 2 |  |  |  |  | 8 | $self->{validate}     = \&Apache::Session::Generate::MD5::validate; | 
| 21 | 2 |  |  |  |  | 7 | $self->{serialize}    = \&Apache::Session::Serialize::Storable::serialize; | 
| 22 | 2 |  |  |  |  | 6 | $self->{unserialize}  = \&Apache::Session::Serialize::Storable::unserialize; | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 2 |  |  |  |  | 7 | return $self; | 
| 25 |  |  |  |  |  |  | } | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | 1; | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | =head1 NAME | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | Apache::Session::SQLite3 - Use DBD::SQLite 1.x for Apache::Session storage | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | =head1 VERSION | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | This document describes version 0.03 of Apache::Session::SQLite3, released | 
| 36 |  |  |  |  |  |  | February 2, 2005. | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | use Apache::Session::SQLite3; | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | tie %hash, 'Apache::Session::SQLite3', $id, { | 
| 43 |  |  |  |  |  |  | DataSource => 'dbi:SQLite:dbname=/tmp/session.db' | 
| 44 |  |  |  |  |  |  | }; | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | # to purge all sessions older than 30 days, do this: | 
| 47 |  |  |  |  |  |  | tied(%hash)->{object_store}{dbh}->do(qq[ | 
| 48 |  |  |  |  |  |  | DELETE FROM Sessions WHERE ? > LastUpdated | 
| 49 |  |  |  |  |  |  | ], {}, time - (30 * 86400)); | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | This module is an implementation of Apache::Session.  It uses the DBD::SQLite | 
| 54 |  |  |  |  |  |  | backing store.  It requires DBD::SQLite version 1.00 or above, due to its use | 
| 55 |  |  |  |  |  |  | of SQLite3 API for BLOB support.  Also, an extra C field is | 
| 56 |  |  |  |  |  |  | populated with the current C | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | There is no need to create the data source file beforehand; this module creates | 
| 59 |  |  |  |  |  |  | the C table automatically. | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | =head1 AUTHOR | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | Autrijus Tang Eautrijus@autrijus.orgE | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | =head1 COPYRIGHT | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | Copyright 2004, 2005 by Autrijus Tang Eautrijus@autrijus.orgE. | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | This program is free software; you can redistribute it and/or modify it | 
| 70 |  |  |  |  |  |  | under the same terms as Perl itself. | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | See L | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | L, L, L | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | =cut |