CGI-Session-Driver-chi-1.0.3/0000755000000000000000000000000012327501533014227 5ustar rootrootCGI-Session-Driver-chi-1.0.3/t/0000755000000000000000000000000012327501533014472 5ustar rootrootCGI-Session-Driver-chi-1.0.3/t/CGI-Session-Driver-chi.t0000644000000000000000000000076112176271047020706 0ustar rootroot# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl CGI-Session-Driver-chi.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; BEGIN { use_ok('CGI::Session::Driver::chi') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. CGI-Session-Driver-chi-1.0.3/Changes0000644000000000000000000000073612327501364015532 0ustar rootrootRevision history for Perl extension CGI::Session::Driver::CHI. 1.0.3 Wed Apr 28 2014 - Incorrect return values for retrieve 1.0.2 Wed Apr 10 2014 - Added dependencies to Makefile.PL 1.0.1 Wed Mar 11 2013 - Updated documentation - Removed debug statements - Added dependencies to Makefile.PL 1.0.0 Tue Nov 5 2013 - Initial release 0.01 Thu May 23 00:59:57 2013 - original version; created by h2xs 1.23 with options -XAn CGI::Session::Driver::CHI CGI-Session-Driver-chi-1.0.3/README0000644000000000000000000000241212236511354015107 0ustar rootrootNAME CGI::Session::Driver::chi SYNOPSIS $s = CGI::Session->new( "driver:chi", $sid, { driver => 'File', root_dir => '/path/to/root' }); $s = CGI::Session->new( "driver:chi", $sid, { chi_class => 'My::CHI', namespace => 'cgi', }); DESCRIPTION This driver allows CGI::Session to use CHI as a session store DRIVER ARGUMENTS It accept a hash ref with the same arguements to would pass to CHI An additional arguement chi_class AUTHOR James Rouzier. COPYRIGHT Copyright (C) 2013 James Rouzier LICENSE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. CGI-Session-Driver-chi-1.0.3/MANIFEST0000644000000000000000000000013512176271034015361 0ustar rootrootChanges Makefile.PL MANIFEST README t/CGI-Session-Driver-chi.t lib/CGI/Session/Driver/chi.pm CGI-Session-Driver-chi-1.0.3/Makefile.PL0000644000000000000000000000132512321524334016200 0ustar rootrootuse 5.010001; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'CGI::Session::Driver::chi', VERSION_FROM => 'lib/CGI/Session/Driver/chi.pm', # finds $VERSION PREREQ_PM => { 'CHI' => 0, 'CGI::Session::ErrorHandler' => "4.0", 'CGI::Session::Driver' => "4.0", }, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT => 'A CGI::Session::Driver for CHI', # retrieve abstract from module AUTHOR => 'James Rouzier ') : ()), ); CGI-Session-Driver-chi-1.0.3/lib/0000755000000000000000000000000012327501533014775 5ustar rootrootCGI-Session-Driver-chi-1.0.3/lib/CGI/0000755000000000000000000000000012327501533015377 5ustar rootrootCGI-Session-Driver-chi-1.0.3/lib/CGI/Session/0000755000000000000000000000000012327501533017022 5ustar rootrootCGI-Session-Driver-chi-1.0.3/lib/CGI/Session/Driver/0000755000000000000000000000000012327501533020255 5ustar rootrootCGI-Session-Driver-chi-1.0.3/lib/CGI/Session/Driver/chi.pm0000644000000000000000000000422412327501215021355 0ustar rootrootpackage CGI::Session::Driver::chi; =head1 NAME CGI::Session::Driver::chi =cut =head1 SYNOPSIS $s = CGI::Session->new( "driver:chi", $sid, { driver => 'File', root_dir => '/path/to/root' }); $s = CGI::Session->new( "driver:chi", $sid, { chi_class => 'My::CHI', namespace => 'cgi', }); =head1 DESCRIPTION This driver allows L to use L as a session store =cut =head2 DRIVER ARGUMENTS It accept a hash ref with the same arguements to would pass to L An additional arguement chi_class =cut use strict; use warnings; use strict; use CHI; use base qw( CGI::Session::Driver CGI::Session::ErrorHandler ); our $VERSION = '1.0.3'; sub init { my ($self) = @_; my %args = %$self; my $chi_class = delete $args{chi_class} || "CHI"; my $chi = $chi_class->new(%args); $self->{CHI} = $chi; return 1; } sub store { my ($self, $sid, $datastr) = @_; $self->{CHI}->set($sid, $datastr); return 1; } sub retrieve { my ($self, $sid) = @_; my $value = $self->{CHI}->get($sid); return 0 unless defined $value; return $value; } sub remove { my ($self, $sid) = @_; $self->{CHI}->remove($sid); return 1; } sub traverse { my ($self, $coderef) = @_; foreach my $key ($self->{CHI}->get_keys) { $coderef->( $key ) } return 1; } =head1 AUTHOR James Rouzier. =head1 COPYRIGHT Copyright (C) 2013 James Rouzier =head1 LICENSE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. =cut 1;