[Catalyst-commits] r6697 - in trunk/Catalyst-Plugin-Session-Store-Cache: . lib lib/Catalyst lib/Catalyst/Plugin lib/Catalyst/Plugin/Session lib/Catalyst/Plugin/Session/Store t

lbr at dev.catalyst.perl.org lbr at dev.catalyst.perl.org
Sun Aug 19 19:04:12 GMT 2007


Author: lbr
Date: 2007-08-19 19:04:12 +0100 (Sun, 19 Aug 2007)
New Revision: 6697

Added:
   trunk/Catalyst-Plugin-Session-Store-Cache/Changes
   trunk/Catalyst-Plugin-Session-Store-Cache/MANIFEST
   trunk/Catalyst-Plugin-Session-Store-Cache/Makefile.PL
   trunk/Catalyst-Plugin-Session-Store-Cache/README
   trunk/Catalyst-Plugin-Session-Store-Cache/lib/
   trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/
   trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/
   trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/Session/
   trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/Session/Store/
   trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/Session/Store/Cache.pm
   trunk/Catalyst-Plugin-Session-Store-Cache/t/
   trunk/Catalyst-Plugin-Session-Store-Cache/t/01use.t
   trunk/Catalyst-Plugin-Session-Store-Cache/t/02pod.t
   trunk/Catalyst-Plugin-Session-Store-Cache/t/03podcoverage.t
Log:
import of 0.01 from CPAN

Added: trunk/Catalyst-Plugin-Session-Store-Cache/Changes
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/Changes	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/Changes	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,6 @@
+Revision history for Perl extension Catalyst::Plugin::Session::Store::Cache.
+
+0.01  Sat Jul 21 14:45:57 2007
+	- original version; created by h2xs 1.23 with options
+		-AX -n Catalyst::Plugin::Session::Store::Cache
+

Added: trunk/Catalyst-Plugin-Session-Store-Cache/MANIFEST
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/MANIFEST	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/MANIFEST	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,8 @@
+Changes
+Makefile.PL
+MANIFEST
+README
+t/01use.t
+t/02pod.t
+t/03podcoverage.t
+lib/Catalyst/Plugin/Session/Store/Cache.pm

Added: trunk/Catalyst-Plugin-Session-Store-Cache/Makefile.PL
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/Makefile.PL	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/Makefile.PL	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,8 @@
+use ExtUtils::MakeMaker;
+WriteMakefile(
+    NAME              => 'Catalyst::Plugin::Session::Store::Cache',
+    VERSION_FROM      => 'lib/Catalyst/Plugin/Session/Store/Cache.pm',
+    PREREQ_PM         => {
+        'Catalyst::Plugin::Session' => '0.06',
+    },
+);

Added: trunk/Catalyst-Plugin-Session-Store-Cache/README
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/README	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/README	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,37 @@
+Catalyst-Plugin-Session-Store-Cache version 0.01
+================================================
+
+The README is used to introduce the module and provide instructions on
+how to install the module, any machine dependencies it may have (for
+example C compilers and installed libraries) and any other information
+that should be provided before the module is installed.
+
+A README file is required for CPAN modules since CPAN extracts the
+README file from a module distribution so that people browsing the
+archive can use it get an idea of the modules uses. It is usually a
+good idea to provide version information here so that people can
+decide whether fixes for the module are worth downloading.
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+      Catalyst::Plugin::Session
+      Some type of Catalyst::Plugin::Cache::...
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2007 by Lars Balker Rasmussen
+
+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.8 or,
+at your option, any later version of Perl 5 you may have available.

Added: trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/Session/Store/Cache.pm
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/Session/Store/Cache.pm	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/lib/Catalyst/Plugin/Session/Store/Cache.pm	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,78 @@
+#!/usr/bin/perl
+
+package Catalyst::Plugin::Session::Store::Cache;
+use base qw/Catalyst::Plugin::Session::Store/;
+
+use strict;
+use warnings;
+
+our $VERSION = "0.01";
+
+my $cache_key_prefix = "catalyst-plugin-session-store-cache:";
+
+sub get_session_data {
+    my ($c, $key) = @_;
+    $c->cache->get($cache_key_prefix . $key);
+}
+
+sub store_session_data {
+    my ($c, $key, $data) = @_;
+    my $expires = $c->config->{session}{expires};
+    $c->cache->set($cache_key_prefix . $key, $data, $expires);
+}
+
+sub delete_session_data {
+    my ( $c, $key ) = @_;
+    $c->cache->remove($cache_key_prefix . $key);
+}
+
+sub delete_expired_sessions { }
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Catalyst::Plugin::Session::Store::Cache - Store sessions using a Catalyst::Plugin::Cache
+
+=head1 SYNOPSIS
+
+    use Catalyst qw/Cache::YourFavoriteCache Session Session::Store::Cache/;
+
+=head1 DESCRIPTION
+
+This plugin will store your session data in whatever cache module you
+have configured.
+
+=head1 METHODS
+
+See L<Catalyst::Plugin::Session::Store>.
+
+=over 4
+
+=item get_session_data
+
+=item store_session_data
+
+=item delete_session_data
+
+=item delete_expired_sessions
+
+=back
+
+=head1 AUTHOR
+
+Lars Balker Rasmussen, E<lt>lbr at cpan.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2007 by Lars Balker Rasmussen
+
+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.8 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut

Added: trunk/Catalyst-Plugin-Session-Store-Cache/t/01use.t
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/t/01use.t	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/t/01use.t	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,4 @@
+use strict;
+use Test::More tests => 1;
+
+BEGIN { use_ok('Catalyst::Plugin::Session::Store::Cache') }

Added: trunk/Catalyst-Plugin-Session-Store-Cache/t/02pod.t
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/t/02pod.t	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/t/02pod.t	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod 1.14";
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_files_ok();

Added: trunk/Catalyst-Plugin-Session-Store-Cache/t/03podcoverage.t
===================================================================
--- trunk/Catalyst-Plugin-Session-Store-Cache/t/03podcoverage.t	                        (rev 0)
+++ trunk/Catalyst-Plugin-Session-Store-Cache/t/03podcoverage.t	2007-08-19 18:04:12 UTC (rev 6697)
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();




More information about the Catalyst-commits mailing list